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
If a summary or histogram is registered with an empty, but present, label set, it is returned with an incorrect
label set because the quantile/vmrange labels are appended with a comma, but there are no labels
before the comma.
I ran into this because I allow user-set custom labels, which may be empty. If I use promutils.NewLabelsFromString or NewLabelsFromMap, and just appended the result to the metric name, I will hit this issue if the user didn't provide custom labels.
Of course I can check if the string/map is empty, or remove the {} in the example below, but it feels like this should be handled.
If a metric name like below (test_summary{}) is considered invalid, it should be rejected during registration, since there's already validation happening at that time.
Here's an executable way to reproduce the issue:
Register a summary/histogram with an empty label set:
If a summary or histogram is registered with an empty, but present, label set, it is returned with an incorrect
label set because the
quantile
/vmrange
labels are appended with a comma, but there are no labelsbefore the comma.
I ran into this because I allow user-set custom labels, which may be empty. If I use
promutils.NewLabelsFromString
orNewLabelsFromMap
, and just appended the result to the metric name, I will hit this issue if the user didn't provide custom labels.Of course I can check if the string/map is empty, or remove the
{}
in the example below, but it feels like this should be handled.If a metric name like below (
test_summary{}
) is considered invalid, it should be rejected during registration, since there's already validation happening at that time.Here's an executable way to reproduce the issue:
test_histogram_bucket
atest_summary
have incorrect label sets starting with a comma.The text was updated successfully, but these errors were encountered: