-
Notifications
You must be signed in to change notification settings - Fork 66
📖 Metrics Docs Maintenance #2024
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
📖 Metrics Docs Maintenance #2024
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2024 +/- ##
=======================================
Coverage 69.28% 69.28%
=======================================
Files 79 79
Lines 7051 7051
=======================================
Hits 4885 4885
Misses 1884 1884
Partials 282 282
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -6,7 +6,7 @@ The following procedure is provided as an example for testing purposes. Do not d | |||
|
|||
In OLM v1, you can use the provided metrics with tools such as the [Prometheus Operator][prometheus-operator]. By default, Operator Controller and catalogd export metrics to the `/metrics` endpoint of each service. | |||
|
|||
You must grant the necessary permissions to access the metrics by using [role-based access control (RBAC) polices][rbac-k8s-docs]. | |||
You must grant the necessary permissions to access the metrics by using [role-based access control (RBAC) polices][rbac-k8s-docs]. You will also need to create a `NetworkPolicy` to allow egress traffic from your scraper pod, as the OLM namespace by default allows only `catalogd` and `operator-controller` to send and receive traffic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think that is required.
See that the NPs that we have should allow already we scrap the metrics
Also, note that we are calling the metrics endpoint at: https://github.com/operator-framework/operator-controller/blob/main/test/e2e/metrics_test.go and we do not create any new NP
If we break it, then in the downstream we would no longer be able to get the metrics, and that is why we have a test to ensure it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried the guide again without the NetworkPolicy and it does not work. After I apply the NetworkPolicy, it works again.
The reason that the e2e test works is that it puts the curl pod into a random namespace, outside of olmv1-system. If you were to create the pod inside olmv1-system, the tests would fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and to your point on downstream metrics, the reason that also works fine is because the metrics scraper pod does not live in the same namespace as catalogd or operator-controller.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. 👍
Thank you for the clarification
@@ -41,6 +60,8 @@ kind: Pod | |||
metadata: | |||
name: curl-metrics | |||
namespace: olmv1-system | |||
labels: | |||
metrics: scraper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we need the label?
see: https://github.com/operator-framework/operator-controller/blob/main/test/e2e/metrics_test.go#L129-L154
We do not need the label
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NP added is matching with the label 👍
@@ -131,6 +155,8 @@ kind: Pod | |||
metadata: | |||
name: curl-metrics-catalogd | |||
namespace: olmv1-system | |||
labels: | |||
metrics: scraper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do not need either
@@ -253,7 +282,7 @@ metadata: | |||
spec: | |||
endpoints: | |||
- path: /metrics | |||
port: https | |||
port: metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates the docs around metrics gathering to include necessary NetworkPolicy, fixes some errors in the ServiceMonitor yaml for securityContext and catalogd labels, and makes the example curl commands easier to execute. Signed-off-by: Daniel Franz <dfranz@redhat.com>
17b7494
to
1e7ca6f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Great work 🥇
@dtfranz, thank you for checking that we need to update the docs after introducing the NP and working on it proactively.
/approved
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86 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:
Approvers can indicate their approval by writing |
1a27741
into
operator-framework:main
Updates the docs around metrics gathering to include necessary NetworkPolicy, and fixes some errors in the ServiceMonitor yaml for securityContext and catalogd labels.
Description
Reviewer Checklist