Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registration-service: new Service to /metrics #1051

Merged
merged 7 commits into from
Jul 2, 2024

Conversation

xcoulon
Copy link
Contributor

@xcoulon xcoulon commented Jun 24, 2024

new k8s Service to scrape the HTTP metrics from the registration
service, but without exposing them to the current Route
(the metrics will be exposed in a separate port in the
registration service pods)

see codeready-toolchain/registration-service#436

note: this PR needs to be merged so that the new test in codeready-toolchain/toolchain-e2e#1001 can pass ;)

Signed-off-by: Xavier Coulon [email protected]

@alexeykazakov
Copy link
Contributor

this PR needs to be merged so that the new test in codeready-toolchain/toolchain-e2e#1001 can pass

I'm curius why you don't pair these PRs?

@xcoulon
Copy link
Contributor Author

xcoulon commented Jun 25, 2024

this PR needs to be merged so that the new test in codeready-toolchain/toolchain-e2e#1001 can pass

I'm curius why you don't pair these PRs?

The e2e tests are paired with the registration-service, which contains the code to collect and expose the metrics on a new port. But before we can run the e2e tests, I need an update in how the host-operator deploys the registration service (ie, we need a new Service)

@xcoulon xcoulon closed this Jun 25, 2024
@xcoulon xcoulon reopened this Jun 25, 2024
new k8s Service to scrape the HTTP metrics from the registration
service, but without exposing them to the current Route
(the metrics will be exposed in a separate port in the
registration service pods)

see codeready-toolchain/registration-service#436

Signed-off-by: Xavier Coulon [email protected]
@xcoulon xcoulon force-pushed the regsvc_metrics_service branch from a7552f7 to 69b594f Compare June 25, 2024 06:28
@@ -86,7 +86,7 @@ func TestReconcile(t *testing.T) {
Exists().
HasConditions(
toolchainconfig.ToSyncComplete(),
toolchainconfig.ToRegServiceDeploying("updated resources: [ServiceAccount: registration-service Role: registration-service RoleBinding: registration-service Deployment: registration-service Service: registration-service Route: registration-service Service: api Route: api Service: proxy-metrics-service]")).
toolchainconfig.ToRegServiceDeploying("updated resources: [ServiceAccount: registration-service Role: registration-service RoleBinding: registration-service Deployment: registration-service Route: registration-service Service: registration-service Service: registration-service-metrics Route: api Service: api Service: proxy-metrics-service]")).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to your changes - I'm a bit confused with those conditions, not sure what are those for 🤔

- containerPort: 8082
- containerPort: 8080 # registration service
- containerPort: 8081 # proxy
- containerPort: 8082 # proxy metrics
name: metrics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

optional - maybe we could rename this to proxy-metrics

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, indeed, although I did not want to bring too many changes here, in case it's used by Konflux 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

@xcoulon
Copy link
Contributor Author

xcoulon commented Jun 25, 2024

/test e2e

@@ -168,6 +154,7 @@ objects:
namespace: ${NAMESPACE}
spec:
host: ''
path: /api # we don't want to expose anything else (eg: Prometheus metrics)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a route for the registration service.
but still, do we really need to limit it? isn't it already limited/isolated using services and ports?
apart from that - would it also allow requests on the /apis path? it's used in openshift as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohhh, that's a mistake, I thought I reverted that change! 🤦‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed in 7e58490

Signed-off-by: Xavier Coulon <[email protected]>
@xcoulon
Copy link
Contributor Author

xcoulon commented Jun 25, 2024

/test e2e

Copy link

openshift-ci bot commented Jul 2, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexeykazakov, MatousJobanek, mfrancisc, xcoulon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [MatousJobanek,alexeykazakov,mfrancisc,xcoulon]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.89%. Comparing base (9bd7110) to head (c2aefe5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1051   +/-   ##
=======================================
  Coverage   84.89%   84.89%           
=======================================
  Files          55       55           
  Lines        5012     5012           
=======================================
  Hits         4255     4255           
  Misses        584      584           
  Partials      173      173           

see 2 files with indirect coverage changes

@xcoulon xcoulon merged commit f282cde into codeready-toolchain:master Jul 2, 2024
9 of 11 checks passed
@xcoulon xcoulon deleted the regsvc_metrics_service branch July 2, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants