Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ release.
([#4952](https://github.com/open-telemetry/opentelemetry-specification/pull/4952))
- Stabilize OpenTelemetry Attributes to Prometheus labels transformation.
([#4963](https://github.com/open-telemetry/opentelemetry-specification/pull/4963))
- Stabilize Prometheus Exemplar to OpenTelemetry Exemplar transformation.
([#4962](https://github.com/open-telemetry/opentelemetry-specification/pull/4962))

### SDK Configuration

Expand Down
31 changes: 22 additions & 9 deletions specification/compatibility/prometheus_and_openmetrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ under the `prometheus.type` key (e.g. `prometheus.type="unknown"`).

A [Prometheus Counter](https://prometheus.io/docs/instrumenting/exposition_formats/#basic-info) MUST be converted to an OTLP Sum with `is_monotonic` equal to `true`.

Exemplars on the Prometheus Counter Sample MUST be converted to OpenTelemetry
Exemplars on the OpenTelemetry Sum data point following the rules in
[Exemplars](#exemplars).

### Gauges

**Status**: [Stable](../document-status.md)
Expand Down Expand Up @@ -148,6 +152,10 @@ In the text format, Prometheus histograms buckets, count and sum are sent as sep
* If `_count` is not present, the metric MUST be dropped.
* If `_sum` is not present, the histogram's sum MUST be unset.

Exemplars on the Prometheus Histogram Sample MUST be converted to OpenTelemetry
Exemplars on the OpenTelemetry Histogram data point following the rules in
[Exemplars](#exemplars).

### Native Histograms

**Status**: [Stable](../document-status.md)
Expand Down Expand Up @@ -244,6 +252,10 @@ Native histograms of the float or gauge flavors MUST be dropped.
Native Histograms with `Schema` outside of the range [-4, 8] and not equal to
-53 MUST be dropped.

Exemplars on the Prometheus Native Histogram Sample MUST be converted to
OpenTelemetry Exemplars on the OpenTelemetry Exponential Histogram data point
following the rules in [Exemplars](#exemplars).
Comment thread
dashpole marked this conversation as resolved.

### Summaries

**Status**: [Stable](../document-status.md)
Expand Down Expand Up @@ -276,17 +288,18 @@ Prometheus Cumulative metrics can include the start time using the [`_created` s

### Exemplars

**Status**: [Development](../document-status.md)
**Status**: [Stable](../document-status.md)

[Prometheus Exemplars](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#exemplars)
can be attached to Prometheus Histogram bucket metric points and counter metric
points. Exemplars on histogram buckets SHOULD be converted to exemplars on
OpenTelemetry histograms. Exemplars on counter metric points SHOULD be
converted to exemplars on OpenTelemetry sums. If present, the timestamp
MUST be added to the OpenTelemetry exemplar. The Trace ID and Span ID SHOULD be
retrieved from the `trace_id` and `span_id` label keys, respectively. All
labels not used for the trace and span IDs MUST be added to the OpenTelemetry
exemplar as attributes.
MUST be converted to OpenTelemetry Exemplars as follows:

* If present, the timestamp MUST be used as the OpenTelemetry exemplar's
timestamp.
* If present, and if the values are valid Trace and Span IDs, the `trace_id` and
`span_id` labels MUST be converted to the OpenTelemetry Exemplar's Trace ID and
Span ID, respectively.
* All labels other than `trace_id` and `span_id` MUST be added to the OpenTelemetry
exemplar as filtered attributes.

### Instrumentation Scope

Expand Down
Loading