Skip to content
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

Prometheus example for the histogram produces incorrect exposition output #1432

Closed
dc6c opened this issue Jun 7, 2022 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@dc6c
Copy link

dc6c commented Jun 7, 2022

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."

@dc6c dc6c added the bug Something isn't working label Jun 7, 2022
@lalitb lalitb self-assigned this Jun 7, 2022
@lalitb lalitb added this to the Metrics SDK - Release Candidate milestone Jun 7, 2022
@lalitb
Copy link
Member

lalitb commented Jun 9, 2022

related to #1437. The Prometheus exporter is not adding labels to the time series data, so all the data seems to be for the same metric.

@lalitb
Copy link
Member

lalitb commented Jun 10, 2022

fixed by #1440. Please reopen if there are still any issues.

@lalitb lalitb closed this as completed Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants