-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Prometheus exponential histogram validate scale range #6779
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
Labels
Milestone
Comments
@MrAlias could I pick this up? |
highlyavailable
added a commit
to highlyavailable/opentelemetry-go
that referenced
this issue
May 24, 2025
highlyavailable
added a commit
to highlyavailable/opentelemetry-go
that referenced
this issue
May 24, 2025
highlyavailable
added a commit
to highlyavailable/opentelemetry-go
that referenced
this issue
May 24, 2025
highlyavailable
added a commit
to highlyavailable/opentelemetry-go
that referenced
this issue
May 30, 2025
highlyavailable
added a commit
to highlyavailable/opentelemetry-go
that referenced
this issue
May 30, 2025
… compatibility Implements scale validation and bucket re-aggregation for exponential histograms to ensure compatibility with Prometheus native histograms, which support scales in the range [-4, 8]. - Reject scales below -4 with error logging (skip data point) - Downscale histograms with scale > 8 by re-aggregating buckets - Add downscaleExponentialBucket function that merges buckets when downscaling - Fix overflow/underflow checks to handle negative bucket offsets correctly - Add comprehensive tests for scale validation and bucket downscaling Fixes open-telemetry#6779
highlyavailable
added a commit
to highlyavailable/opentelemetry-go
that referenced
this issue
May 30, 2025
highlyavailable
added a commit
to highlyavailable/opentelemetry-go
that referenced
this issue
May 30, 2025
… compatibility Implements scale validation and bucket re-aggregation for exponential histograms to ensure compatibility with Prometheus native histograms, which support scales in the range [-4, 8]. - Reject scales below -4 with error logging (skip data point) - Downscale histograms with scale > 8 by re-aggregating buckets - Add downscaleExponentialBucket function that merges buckets when downscaling - Fix overflow/underflow checks to handle negative bucket offsets correctly - Add comprehensive tests for scale validation and bucket downscaling Fixes open-telemetry#6779
highlyavailable
added a commit
to highlyavailable/opentelemetry-go
that referenced
this issue
May 30, 2025
Fixes open-telemetry#6779 Add scale validation for Prometheus exponential histograms to ensure compatibility with Prometheus native histogram format. Changes: - Validate scale is within Prometheus supported range [-4, 8] - Reject scales below -4 (log error and skip data point) - Downscale histograms with scale > 8 by re-aggregating buckets - Add comprehensive test coverage for scale validation and downscaling - Implement downscaling logic based on OpenTelemetry Collector Contrib The downscaling implementation merges buckets using bit-shifting to maintain accuracy while conforming to Prometheus limitations.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm doing a late review of #6421, and am comparing it to the implementation here: https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/9cb3ada6449ae195aa904f82f1ac972ff401974b/pkg/translator/prometheusremotewrite/histograms.go#L50
We need to ensure the scale is valid for Prometheus (-4 to 8), and scale down if it is greater than 8, or reject.
cc @GiedriusS
The text was updated successfully, but these errors were encountered: