-
Notifications
You must be signed in to change notification settings - Fork 177
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
Use the same Help for metrics with and without labels #122
Use the same Help for metrics with and without labels #122
Conversation
When metrics are pre-registered with Help and without labels, when issuing metrics with labels, the help was filled with the key_name. But prometheus client enforces help to be consistent accross several elements, so, it can break at Runtime if a metric has been declared without its labels and later issued this metric with labels. In order to fix this, we store the help declared at startup for each key, so, when declaring a metric with some labels, we try to re-used pre-declared help for the metric. It should fix the issue that appeared with Consul 1.9.x and fix hashicorp/consul#9471
fab8c8a
to
923ff58
Compare
Hello @mkcp Maybe you could have a look at this PR to fix hashicorp/consul#9303 and hashicorp/consul#9198 Thank you! |
@pierresouchay Awesome!! Thank you for putting together a patch to address hashicorp/consul#9303. I've loaded this up on a local docker cluster and I can confirm that the warning messages at Consul startup and runtime are gone. Also, looking at metrics with dynamic labels - they are correctly batched with the correct metric name & help text. E.g. the |
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 great to me! Appreciate the tests as well
LGTM, thanks Pierre! |
I created v0.3.6 |
Thank you @banks ! Made the update in hashicorp/consul#9510 |
When metrics are pre-registered with Help and without labels,
when issuing metrics with labels, the help was filled with
the key_name.
But prometheus client enforces help to be consistent accross
several elements, so, it can break at Runtime if a metric
has been declared without its labels and later issued this metric
with labels.
In order to fix this, we store the help declared at startup for
each key, so, when declaring a metric with some labels, we try
to re-used pre-declared help for the metric.
It should fix the issue that appeared with Consul 1.9.x and
fix hashicorp/consul#9471