You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We provide the init_label_set method to deal with the "Missing Metrics" problem on metrics that have labels.
However, we should automatically initialize the empty labelset for metrics that don't take any labels, so a 0 is exported.
A caller could call init_label_set({}), but it's unintuitive, and the Prometheus documentation itself sets the expectation that this will be done for you.
Q: Is this a patch, minor or major?
On the one hand, this is kind of a bug fix. We should've done this when we introduced init_label_set
On the other hand, this is definitely going to affect the output of a client, which may surprise some folk, so it may count as a breaking change. But... It's making that output "more correct". I'm not entirely sure here.
Q: We should 100% do this for counters. Should we also do it for Gauges, etc?
I'd take a cue from the Python/Go clients, do the same they do.
NB: If i'm reading the code correctly, the Python library does this, by calling _metric_init for is_observable metrics, which includes label-less ones, and those with pre-set label values.
The text was updated successfully, but these errors were encountered:
We provide the
init_label_set
method to deal with the "Missing Metrics" problem on metrics that have labels.However, we should automatically initialize the empty labelset for metrics that don't take any labels, so a 0 is exported.
A caller could call
init_label_set({})
, but it's unintuitive, and the Prometheus documentation itself sets the expectation that this will be done for you.Q: Is this a patch, minor or major?
On the one hand, this is kind of a bug fix. We should've done this when we introduced
init_label_set
On the other hand, this is definitely going to affect the output of a client, which may surprise some folk, so it may count as a breaking change. But... It's making that output "more correct". I'm not entirely sure here.
Q: We should 100% do this for counters. Should we also do it for Gauges, etc?
I'd take a cue from the Python/Go clients, do the same they do.
NB: If i'm reading the code correctly, the Python library does this, by calling
_metric_init
foris_observable
metrics, which includes label-less ones, and those with pre-set label values.The text was updated successfully, but these errors were encountered: