diff --git a/CHANGELOG.md b/CHANGELOG.md index a140cef5413..a2cb3b7492a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,8 @@ release. ([#4898](https://github.com/open-telemetry/opentelemetry-specification/pull/4898)) - Stabilize Prometheus Dropped Types transformation. ([#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)) ### SDK Configuration diff --git a/specification/compatibility/prometheus_and_openmetrics.md b/specification/compatibility/prometheus_and_openmetrics.md index d3014b85490..e36b38ef9fe 100644 --- a/specification/compatibility/prometheus_and_openmetrics.md +++ b/specification/compatibility/prometheus_and_openmetrics.md @@ -365,8 +365,6 @@ in keys). ## OTLP Metric points to Prometheus -**Status**: [Development](../document-status.md) - ### Metric Metadata **Status**: [Development](../document-status.md) @@ -520,21 +518,20 @@ An [OpenTelemetry Summary](../metrics/data-model.md#summary-legacy) MUST be conv ### Metric Attributes -**Status**: [Development](../document-status.md) +**Status**: [Stable](../document-status.md) OpenTelemetry Metric Attributes MUST be converted to [Prometheus labels](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). String Attribute values are converted directly to Metric Attributes, and non-string Attribute values MUST be converted to string attributes following -the [attribute specification](../common/README.md#attribute). Prometheus +the [attribute specification](../common/README.md#anyvalue-representation-for-non-otlp-protocols). Prometheus naming conventions encourage metric names to match the following regular expression: -`[a-zA-Z_]([a-zA-Z0-9_])*`. Discouraged characters SHOULD be replace with the `_` character. -Multiple consecutive `_` characters SHOULD be replaced with a single `_` -character. This may cause ambiguity in scenarios where multiple similar-named -attributes share invalid characters at the same location. In such unlikely -cases, if multiple key-value pairs are converted to have the same Prometheus -key, the values MUST be concatenated together, separated by `;`, and ordered by -the lexicographical order of the original keys. +`[a-zA-Z_]([a-zA-Z0-9_])*`. Discouraged characters SHOULD be replaced with the +`_` character. Multiple consecutive `_` characters SHOULD be replaced with a +single `_` character. This conversion, or other labels (e.g. `otel_scope_name`) +added by this specification, may cause different OpenTelemetry keys to map to +the same Prometheus key. In such cases, the values MUST be concatenated together, +separated by `;`, and ordered by the lexicographical order of the original keys. ### Exemplars