Repository navigation
[surfacers.otel] Export native distributions as exponential histograms - #1515
Merged
Merged
Conversation
OTel's exponential histogram uses the same bucket boundaries as native buckets (scale is the same as schema), so distributions with native buckets map to it directly. The only difference is in bucket numbering: native bucket i is OTel's bucket i-1. Regular distributions are still exported as explicit bucket histograms. Part of #1480.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second part of native histogram support (#1480), after #1514. Distributions with native buckets are now exported as OTel exponential histograms instead of explicit-bucket histograms. Nothing changes for regular distributions.
Scaleis the schema, and count, sum and zero count carry over. Zero threshold is 0.icovers(base^i, base^(i+1)], while native bucketicovers(base^(i-1), base^i]. So native bucketigoes out as OTel bucketi-1.Testing
Unit tests cover the conversion, including values that are exactly on bucket boundaries, zeros and negative values.
Also ran cloudprober with
latency_distribution { native_buckets {} }and the OTLP/HTTP exporter pointed at a small local receiver that decodes the request.cloudprober_latencyarrived as an exponential histogram (scale 3, cumulative), and its offset and bucket counts matched the file surfacer output for the same data. Not tested against a real collector or backend.