From 3dfb383fe583e3b74a2365c5a1d90256b273ee76 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Thu, 23 May 2024 14:10:52 +0000 Subject: [PATCH 1/2] clarify that unit must be a suffix for metric names --- CHANGELOG.md | 3 +++ specification/compatibility/prometheus_and_openmetrics.md | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 24a8a4b8adb..63382fe20e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ release. ### Compatibility +- Prometheus: Clarify location of unit suffix within metric names. + ([#4057](https://github.com/open-telemetry/opentelemetry-specification/pull/4057)) + ### SDK Configuration ### Common diff --git a/specification/compatibility/prometheus_and_openmetrics.md b/specification/compatibility/prometheus_and_openmetrics.md index 824ea018c9d..8b1dfb5db3d 100644 --- a/specification/compatibility/prometheus_and_openmetrics.md +++ b/specification/compatibility/prometheus_and_openmetrics.md @@ -267,9 +267,9 @@ The Unit of an OTLP metric point SHOULD be converted to the equivalent unit in P The resulting unit SHOULD be added to the metric as [UNIT metadata](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#metricfamily) -and as a suffix to the metric name unless the metric name already contains the -unit, or the unit MUST be omitted. The unit suffix comes before any -type-specific suffixes. +and as a suffix to the metric name unless the metric name already ends with the +unit (before type-specific suffixes), or the unit MUST be omitted. The unit +suffix comes before any type-specific suffixes. The description of an OTLP metrics point MUST be added as [HELP metadata](https://prometheus.io/docs/instrumenting/exposition_formats/#comments-help-text-and-type-information). From 3786e62ab75a9a7c2f81735f794d2099845cd159 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Fri, 24 May 2024 14:16:12 +0000 Subject: [PATCH 2/2] clarify that the unit metadata must be omitted if the unit suffix is not present --- specification/compatibility/prometheus_and_openmetrics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/compatibility/prometheus_and_openmetrics.md b/specification/compatibility/prometheus_and_openmetrics.md index 8b1dfb5db3d..9ed1439d829 100644 --- a/specification/compatibility/prometheus_and_openmetrics.md +++ b/specification/compatibility/prometheus_and_openmetrics.md @@ -268,8 +268,8 @@ The Unit of an OTLP metric point SHOULD be converted to the equivalent unit in P The resulting unit SHOULD be added to the metric as [UNIT metadata](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#metricfamily) and as a suffix to the metric name unless the metric name already ends with the -unit (before type-specific suffixes), or the unit MUST be omitted. The unit -suffix comes before any type-specific suffixes. +unit (before type-specific suffixes), or the unit metadata MUST be omitted. The +unit suffix comes before any type-specific suffixes. The description of an OTLP metrics point MUST be added as [HELP metadata](https://prometheus.io/docs/instrumenting/exposition_formats/#comments-help-text-and-type-information).