Skip to content

Define conversion of prometheus native histograms to OpenTelemetry exponential histograms #4561

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dashpole
Copy link
Contributor

Part of #4494

Changes

This conversion is the inverse of the exp -> native conversion defined here: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#exponential-histograms.

@open-telemetry/prometheus-interoperability @ywwg @krajorama

Copy link
Member

@krajorama krajorama left a comment

Choose a reason for hiding this comment

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

thank you for starting this, I haven't got around to it yet

@@ -131,6 +132,29 @@ Multiple Prometheus histogram metrics MUST be merged together into a single OTLP
* If `_count` is not present, the metric MUST be dropped.
* If `_sum` is not present, the histogram's sum MUST be unset.

### Native Histograms
Copy link
Member

Choose a reason for hiding this comment

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

The spec says this about native histograms at the top:

    Exponential (Native) Histograms are not currently supported in the Prometheus text exposition format or the OpenMetrics text or proto formats.
        Exponential (Native) Histograms SHOULD be dropped if they are not supported, or MAY be converted to fixed-bucket histograms.

You might want to change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Has this actually changed? I know there was a proposed text format, but wasn't sure if that was implemented yet.

dashpole and others added 3 commits June 27, 2025 19:37
Co-authored-by: George Krajcsovits <krajorama@users.noreply.github.com>
@dashpole dashpole force-pushed the native_histograms branch from 5ac176e to bd56bea Compare June 27, 2025 19:37
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.

3 participants