Skip to content

Prometheus: set native histogram zero threshold to zero if not set - #5418

Open
krajorama wants to merge 2 commits into
open-telemetry:mainfrom
krajorama:krajo/native-histogram-zero-threshold
Open

krajorama wants to merge 2 commits into
open-telemetry:mainfrom
krajorama:krajo/native-histogram-zero-threshold

Conversation

@krajorama

@krajorama krajorama commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Fixes #5272 (review) comment where @aknuds1 found that using 1e-128 as the fallback value for undefined zero threshold in the
OpenTelemetry Exponential Histogram to Prometheus native histograms conversion can yield a native histogram
where the zero bucket overlaps positive (or negative) exponential buckets.

This is due to the default 1e-128 number being greater than the smallest possible bucket boundaries (~`2^-1070).

Implementations are not following even the current specification, to be updated, see linked PRs.

Changes

When converting an OpenTelemetry Exponential Histogram to a Prometheus Native Histogram, if ZeroThreshold is not set, set the Native Histogram ZeroThreshold to zero instead of the default value 1e-128.

🤖 Generated with Claude Code

When converting OpenTelemetry exponential histograms to Prometheus native
histograms, set the ZeroThreshold to zero instead of 1e-128 if it is not set.

Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@krajorama
krajorama requested a review from a team as a code owner November 9, 2026 08:53
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-11-09 16:49 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

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