🌱 Add priority label to PQ depth metric#3156
🌱 Add priority label to PQ depth metric#3156k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
Conversation
|
/assign @alvaroaleman /hold |
alvaroaleman
left a comment
There was a problem hiding this comment.
Looks good but one comment re double registration
|
|
||
| depthWithPriority = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
| Subsystem: WorkQueueSubsystem, | ||
| Name: DepthKey, |
There was a problem hiding this comment.
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.
Very good point. This only "worked" because I forgot to register the new metric
There was a problem hiding this comment.
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. DetailsGit 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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/hold cancel |
Part of #2374