diff --git a/CHANGELOG.md b/CHANGELOG.md index 8205433da11..bcd4f0e32cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,9 @@ release. ### Compatibility +- Stabilize Prometheus Classic Histogram to OTLP Explicit Histogram transformation. + ([#4874](https://github.com/open-telemetry/opentelemetry-specification/pull/4874)) + ### SDK Configuration ### Supplementary Guidelines diff --git a/specification/compatibility/prometheus_and_openmetrics.md b/specification/compatibility/prometheus_and_openmetrics.md index 97189cded43..779f028bc88 100644 --- a/specification/compatibility/prometheus_and_openmetrics.md +++ b/specification/compatibility/prometheus_and_openmetrics.md @@ -137,14 +137,14 @@ A [Prometheus Unknown](https://prometheus.io/docs/instrumenting/exposition_forma ### Histograms -**Status**: [Development](../document-status.md) +**Status**: [Stable](../document-status.md) + +A [Prometheus Histogram](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#histogram) MUST be converted to an [OTLP Histogram](https://opentelemetry.io/docs/specs/otel/metrics/data-model/#histogram). -A [Prometheus Histogram](https://prometheus.io/docs/instrumenting/exposition_formats/#basic-info) MUST be converted to an OTLP Histogram. +Prometheus bucket boundaries become OTLP explicit bounds, except the +Inf boundary which is dropped. The sample values associated with the Prometheus bucket boundaries become OTLP bucket counts, including the value associated with the +Inf boundary. The Prometheus Histogram Count becomes the OTLP Histogram Count and Prometheus Histogram Sum becomes OTLP Histogram Sum. -Multiple Prometheus histogram metrics MUST be merged together into a single OTLP Histogram: +In the text format, Prometheus histograms buckets, count and sum are sent as separate samples and they MUST be merged together when forming an OTLP Histogram. Samples with a `_bucket` suffix will have an `le` label denoting the bucket boundary, whose value is the total count of observations less than the bucket boundary. The count of the OpenTelemetry bucket is computed as the difference between the bucket and the next-lowest bucket, if it exists. Lines with `_count` and `_sum` suffixes are used to determine the histogram's count and sum. -* The `le` label on the `_bucket`-suffixed metric is used to identify and order histogram bucket boundaries. Each Prometheus line produces one bucket count on the resulting histogram. Each value for the `le` label except `+Inf` produces one bucket boundary. -* Lines with `_count` and `_sum` suffixes are used to determine the histogram's count and sum. * If `_count` is not present, the metric MUST be dropped. * If `_sum` is not present, the histogram's sum MUST be unset.