Skip to content

feat(spec/compat): stabilize OTel exponential histogram to Prometheus - #5272

Open
krajorama wants to merge 4 commits into
open-telemetry:mainfrom
krajorama:krajo/stabilize-expo-histograms
Open

krajorama wants to merge 4 commits into
open-telemetry:mainfrom
krajorama:krajo/stabilize-expo-histograms

Conversation

@krajorama

@krajorama krajorama commented Aug 17, 2026 •

Copy link
Copy Markdown
Member

Blocked on general discussion in #5273 first.

Follows #5125

Fixes #4922

Changes

Stabilize the OpenTelemetry Exponential Histogram to Prometheus Native Histogram with standard (exponential) schema transformation.

Please provide a brief description of the changes here.

For non-trivial changes, follow the change proposal process.

  • Related issues #
  • [N/A] Related OTEP(s) #
  • [N/A] Links to the prototypes (when adding or changing features)
  • CHANGELOG.md file updated for non-trivial changes
    • For trivial changes, include [chore] in the PR title to skip the changelog check
  • Spec compliance matrix updated if necessary
  • Declarative config data model is updated if SDK config surface is changed

@krajorama
krajorama requested a review from a team as a code owner August 17, 2026 07:56
Stabilize the OpenTelemetry Exponential Histogram to Prometheus Native
Histogram with standard (exponential) schema transformation.

Follows open-telemetry#5121
Fixes: 4922
@krajorama
krajorama force-pushed the krajo/stabilize-expo-histograms branch from 05b4834 to 8912083 Compare August 17, 2026 07:56
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-11-09 09:03 UTC

Respond to 1 review item (e.g. link a commit, explain why not, ask a follow-up):

  • Top-level threads: 1
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.
  • Should this be with reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

@krajorama
krajorama marked this pull request as draft August 17, 2026 08:41
@jmacd jmacd self-assigned this Aug 19, 2026
@github-actions

Copy link
Copy Markdown

This PR was marked stale. It will be closed in 14 days without additional activity.

@github-actions github-actions Bot added the Stale label Sep 17, 2026
@jmacd jmacd removed the Stale label Oct 1, 2026
@dashpole

Copy link
Copy Markdown
Contributor

@krajorama can we move forward with this now that #5273 is resolved?

@krajorama
krajorama marked this pull request as ready for review October 19, 2026 13:09
@krajorama

Copy link
Copy Markdown
Member Author

@krajorama can we move forward with this now that #5273 is resolved?

Yes, I think so , the one open question was resolved here #5125 (comment)

@dashpole
dashpole self-requested a review October 19, 2026 13:42
@dashpole

Copy link
Copy Markdown
Contributor

@ArthurSens @aknuds1 PTAL for prometheus SIG approval

@jmacd @jsuereth @jack-berg PTAL for a second approval.

@dashpole

Copy link
Copy Markdown
Contributor

Follows #5121

Probably a typo?

@aknuds1 aknuds1 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my changelog comment.

Otherwise, I found a potential existing issue in the section being stabilized: an unset ZeroThreshold becomes 1e-128, which can put populated regular buckets entirely inside the zero range. Should unset ZeroThreshold be treated as 0 instead, before stabilizing?

Comment thread CHANGELOG.md Resolved
@ArthurSens

ArthurSens commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

@dashpole

dashpole commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Should unset ZeroThreshold be treated as 0 instead, before stabilizing?

This sounds correct to me.

https://github.com/open-telemetry/opentelemetry-go/blob/cad47393822fd9e3623ea3a379987c15e24db3d6/sdk/metric/metricdata/data.go#L182

This doesn't seem like a bug?

https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/11b6fa1b8177ed88b8370b34dff3ab36a3dfbf27/pkg/translator/prometheusremotewrite/histograms_v2.go#L106-L108

https://github.com/prometheus/prometheus/blob/caebd2cf97a5b09ffab38a276f642348c58eef10/storage/remote/otlptranslator/prometheusremotewrite/histograms.go#L134

We should bring these (and any other conversion logic for this in the collector, sdk exporters, and bridges) into compliance after we do "ZeroThreshold be treated as 0 instead, before stabilizing".

@opentelemetry-pr-dashboard

Copy link
Copy Markdown

Hi @krajorama — just a friendly reminder that this pull request is waiting on you. The dashboard status comment has the open items and is kept current.

  • Replying is enough to hand it off — answer, explain why no change is needed, or ask a follow-up. The dashboard routes it onward once nothing on the list is waiting on you.
  • To hand it back for any other reason, including the dashboard getting this wrong, comment /dashboard route:reviewers.

@krajorama

Copy link
Copy Markdown
Member Author

Should unset ZeroThreshold be treated as 0 instead, before stabilizing?

This sounds correct to me.

Me too. Arve is right the problem is that we can overlap with actual buckets since 1e-128 isn't even close to how low exponential buckets can get.

https://github.com/open-telemetry/opentelemetry-go/blob/cad47393822fd9e3623ea3a379987c15e24db3d6/sdk/metric/metricdata/data.go#L182

This doesn't seem like a bug?

https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/11b6fa1b8177ed88b8370b34dff3ab36a3dfbf27/pkg/translator/prometheusremotewrite/histograms_v2.go#L106-L108

https://github.com/prometheus/prometheus/blob/caebd2cf97a5b09ffab38a276f642348c58eef10/storage/remote/otlptranslator/prometheusremotewrite/histograms.go#L134

We should bring these (and any other conversion logic for this in the collector, sdk exporters, and bridges) into compliance after we do "ZeroThreshold be treated as 0 instead, before stabilizing".

Agree opening PR: #5418

@krajorama

Copy link
Copy Markdown
Member Author

Follows #5121

Probably a typo?

Yes, it's #5125

@krajorama

Copy link
Copy Markdown
Member Author

Blocked until #5418 is merged.

songy23 pushed a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Nov 9, 2026
…52834)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Preserve ZeroThreshold in remote-write v1/v2 exporters and Prometheus
exporter, as discussed in
open-telemetry/opentelemetry-specification#5272 (comment)

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes

<!--Describe what testing was performed and which tests were added.-->
#### Testing

<!--Describe the documentation added.-->
#### Documentation

<!--Authorship attestation. See AGENTS.md for details. AI agents must
not check this box on behalf
of the user; the human author must check it themselves before the PR is
ready for review.-->
#### Authorship

- [x] I, a human, wrote this pull request description myself.

<!--Please delete paragraphs that you did not use before submitting.-->

---------

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
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.

[prometheus] Stabilize OTLP->Prometheus: Exponential Histograms

5 participants