-
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
🌱 Add priority label to PQ depth metric #3156
Conversation
/assign @alvaroaleman /hold |
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.
Looks good but one comment re double registration
pkg/internal/metrics/workqueue.go
Outdated
}, []string{"name", "controller"}) | ||
|
||
depthWithPriority = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Subsystem: WorkQueueSubsystem, | ||
Name: DepthKey, |
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.
Are you sure that prometheus allows to register the same metric twice in general and in particular with different labels?
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.
Very good point. This only "worked" because I forgot to register the new metric
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.
Now I'm only using one metric. The result is the following
Metrics endpoint
# controller with enabled PQ:
workqueue_depth{controller="cluster",name="cluster",priority="0"} 0
# controller with disabled PQ:
workqueue_depth{controller="machine",name="machine",priority=""} 0
Prometheus

Labels with an empty label value are considered equivalent to labels that do not exist.
https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels
OpenMetrics
Empty label values SHOULD be treated as if the label was not present.
https://github.com/prometheus/OpenMetrics/blob/main/specification/OpenMetrics.md#label
8ae9cba
to
3c3fd3e
Compare
LGTM label has been added. Git tree hash: 11dae92c12c13005b9969a10867bd6ac5d763a5a
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, sbueringer 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 |
/hold cancel |
Part of #2374