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

OTLP Histogram missing bucket count for positive infinity #3934

Closed
lenin-jaganathan opened this issue Jun 23, 2023 · 3 comments
Closed

OTLP Histogram missing bucket count for positive infinity #3934

lenin-jaganathan opened this issue Jun 23, 2023 · 3 comments
Assignees
Labels
bug A general bug registry: otlp OpenTelemetry Protocol (OTLP) registry-related
Milestone

Comments

@lenin-jaganathan
Copy link
Contributor

Describe the bug
https://github.com/open-telemetry/opentelemetry-proto/blob/4967b51b5cb29f725978362b9d413bae1dbb641c/opentelemetry/proto/metrics/v1/metrics.proto#L426-L427

The above spec from OpenTelemetry specifies that the count of bucket_counts should be one greater than the count of explicit_bounds with the last bucket_count representing the count of values between last bucket and Positive Infinity. The current implementation in Micormeter doesn't track the values between the last bucket and POSITIVE_INFINITY by default. Even if PSOITIVE_INFINITY is added as an SLO value, the micrometer will add an explicit_bound with the value POSITIVE_INFINITY since the micrometer does a strict 1-1 mapping of values-count.

Environment

  • Micrometer version - 1.11.1 (but it should also exist with 1.10.x)
  • Micrometer registry - OTLP

To Reproduce
How to reproduce the bug:
Configure an OTLPMeterRegistry and add a Timer with histograms enabled.

Expected behavior
bucket_count should be one greater than explicit_bounds and it should represent values between last bucket and positive infinity.

@shakuzen
Copy link
Member

Thanks for bringing this to our attention. Maybe it's just me, but comments in a proto definition don't seem like the best place to specify these things. There's no mention of this in the published documentation for histograms. Could you open an issue with OpenTelemetry to get the relevant info reflected in the documentation? I'm also wondering how OTLP producers are supposed to catch these kinds of issues. It would have been nice if we got some validation failure or at least warning somewhere. Neither the proto nor the OTel collector complain about bucket_count having the wrong number of buckets.

@shakuzen shakuzen added bug A general bug registry: otlp OpenTelemetry Protocol (OTLP) registry-related and removed waiting-for-triage labels Jun 27, 2023
@shakuzen shakuzen added this to the 1.10.x milestone Jun 27, 2023
@lenin-jaganathan
Copy link
Contributor Author

Maybe the word "must" in the proto is the cue for producers. I will open up an issue on the open telemetry docs to address this.

What I see is some of the exporters we are using currently, just ignore all the buckets because the count is not one greater than buckets. I did spend a lot of time debugging but using a LoggingExporter which just prints things as is and I don't see any logs for that. I have to read the proto and try other SDKs (I used NodeJs) to see the difference is the number of counts.

@lenin-jaganathan
Copy link
Contributor Author

lenin-jaganathan commented Jun 27, 2023

#3935 - PR for fixing this. Somehow default linking of issues to PR didn't work. Because, I didn't target the main branch.

I have targeted 1.11.x branch, since 1.10.x and 1.11.x will cause conflicts due to a lot of changes between them (mainly due to delta aggregation support).

@shakuzen shakuzen modified the milestones: 1.10.x, 1.11.2 Jul 6, 2023
@shakuzen shakuzen self-assigned this Jul 6, 2023
@shakuzen shakuzen changed the title OTLPMeterRegistry reports incorrect bucket counts OTLP missing bucket count for positive infinity Jul 6, 2023
@shakuzen shakuzen changed the title OTLP missing bucket count for positive infinity OTLP Histogram missing bucket count for positive infinity Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A general bug registry: otlp OpenTelemetry Protocol (OTLP) registry-related
Projects
None yet
Development

No branches or pull requests

2 participants