-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
📖 document exposed metrics #811
Conversation
Hi @djzager. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
I see that the original comment was referring to the I could follow the same pattern as |
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.
/ok-to-test
/assign @DirectXMan12
/lgtm
Looking around the project at the other metrics packages (ie. controller metrics and webhook metrics) I feel that I took the wrong approach in this PR. What I would like to do would be to export the variables in this package where metrics are defined (making them @DirectXMan12 @vincepri WDYT? |
That sounds good to me as well |
pkg/metrics/workqueue.go
Outdated
// This file is copied and adapted from k8s.io/kubernetes/pkg/util/workqueue/prometheus | ||
// which registers metrics to the default prometheus Registry. We require very | ||
// similar functionality, but must register metrics to a different Registry. | ||
|
||
var ( | ||
// WorkQueueSubsystem defines the subsystem for the workqueue metrics. | ||
WorkQueueSubsystem = "workqueue" |
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.
went ahead and followed what was being done in kubernetes metrics
Went ahead and left it as 2 commits to make it easier to go back to the original if necessary. If this works I'll rebase and squash. |
Hey, so I'm sorry to jump in a bit later here, but:
Due to the way this is currently structured, it means we have out metrics compatibility boundary not at the metrics we expose, but via the exact method we expose them by. For instance, under this model, switching to OpenTelemetry is necessarily a breaking change, even if we expose the same metrics in the same format with the same names, since the Go types change. Considering that the Go types are mostly an implementation detail, that seems suboptimal. Should be easy to fix by moving the actual variables into an internal package, like the other referenced examples. EDIT: looked a the linked examples, clarified what I said a bit. |
Update documentation for the metrics package to enumerate all exposed metrics with an explanation of what they capture.
My idea of making unexported I have updated the metrics package to expose the subsystems and specific keys used without exporting the metrics themselves. I would be tempted to make similar changes in https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/webhook/internal/metrics/metrics.go and https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/internal/controller/metrics/metrics.go but I suspect making exported things unexported would also be a breaking change. It's also possible that |
Ah, yes, your intuition is correct here :-). In Go, and package with |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DirectXMan12, djzager 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 |
Should we cancel the hold on this? |
/hold cancel |
Update documentation for the metrics package to enumerate all exposed
metrics with an explanation of what they capture.
Fixes #262