Skip to content

Fixing rare case for summaries without non-quantile label#22

Open
theZiz wants to merge 1 commit into
yunyu:masterfrom
theZiz:patch-1
Open

Fixing rare case for summaries without non-quantile label#22
theZiz wants to merge 1 commit into
yunyu:masterfrom
theZiz:patch-1

Conversation

@theZiz

@theZiz theZiz commented Apr 28, 2022

Copy link
Copy Markdown

It noticed a special case in Prometheus looking like this

# TYPE my_fancy_metric summary
my_fancy_metric_count 23
my_fancy_metric_sum 42
my_fancy_metric{quantile="0.5"} 0.2
my_fancy_metric{quantile="0.9"} 0.1
my_fancy_metric{quantile="0.95"} 0.05
my_fancy_metric{quantile="0.99"} 0.02

results in a run time error as first the count and sum are handled which creates the flattened struct. Because of this the line flattened[groupName] = {} is not executed later (as only for flattened is checked, not for flattened[groupName] = {}) although it us accessed right after.

It noticed a special case in Prometheus looking like this
```
# TYPE my_fancy_metric summary
my_fancy_metric_count 23
my_fancy_metric_sum 42
my_fancy_metric{quantile="0.5"} 0.2
my_fancy_metric{quantile="0.9"} 0.1
my_fancy_metric{quantile="0.95"} 0.05
my_fancy_metric{quantile="0.99"} 0.02
```
results in a run time error as first the `count` and `sum` are handled which creates the `flattened` struct. Because of this the line `flattened[groupName] = {}` is not executed later (as only for `flattened` is checked, not for `flattened[groupName] = {}`) although it us accessed right after.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant