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

Add "_bucket" suffix to histogram Samples #21

Closed

Conversation

DeusExLibris
Copy link
Contributor

Issue addressed by this PR:
According to the upstream documentation here - bucket counts should take the form _bucket{le="..."}. However, the current code does not add the "_bucket" suffix.

Background:
I discovered this trying to have DataDog import the bucket values. OpenMetrics Histograms were not being processed correctly by DataDog after verifying that I had setup the agent correctly. DataDog was capturing the _count and _sum values but not the buckets. Once I made the change in this PR, the agent started loading the histograms properly.

@fredrikekre
Copy link
Owner

Thanks! I was sure this wasn't in the docs but https://prometheus.io/docs/concepts/metric_types/#histogram mentions this so I don't know why I missed it. I would also note that Grafana seems happy without the _bucket suffix which is why I didn't notice it.

Do you want to update the tests? I think you only have to update

@test sample.suffix === nothing
,
metric_name_histogram{le="1.0"} 1
metric_name_histogram{le="2.0"} 2
metric_name_histogram{le="Inf"} 2
and
@test sample.suffix === nothing

@DeusExLibris
Copy link
Contributor Author

Yes - Grafana does seem to only care that the metric is set to histogram and handles the buckets automatically. This is, in fact, how I discovered the issue. My code was working fine in Grafana but I couldn't get it to work in DataDog.

I will update the tests and submit a new PR.

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.

2 participants