Skip to content

Prometheus example for the histogram produces incorrect exposition output #1432

@dc6c

Description

@dc6c

Describe your environment Windows 10, VS 2019, Bazel 5.0.0

Steps to reproduce

  1. Build: bazel build :prometheus_example from examples/prometheus
  2. Run the example: ..\..\bazel-bin\examples\prometheus\prometheus_example.exe histogram
  3. Get the metrics: curl localhost:8080/metrics

What is the expected behavior?
Output consistent with Prometheus histogram metrics specification:

  1. one entry for prometheus_metric_example_sum
  2. one entry for prometheus_metric_example_count
  3. one entry for each value of label "le" of prometheus_metric_example_bucket (0, 5, 10, etc. up to "+Inf")

What is the actual behavior?
Many entries of each metric, often not with the same value even though the timestamp is the same. E.g.:

prometheus_metric_example_sum 2520.7 1654623992100
prometheus_metric_example_sum 1058.2 1654623992100
prometheus_metric_example_sum 0 1654623992100

This is just an extract, there were exactly 50 entries when I counted them by piping to wc -l. The Prometheus exposition format specification states "Each line must have a unique combination of a metric name and labels. Otherwise, the ingestion behavior is undefined."

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions