From c945ae7620edc5ac1429781a16c53acf56e87449 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Mon, 27 Nov 2023 09:30:12 -0800 Subject: [PATCH 1/4] add optional configuration for prometheus exporter The suffix for types and units can be optionally disabled in Prometheus exporters. This PR captures these configuration options to allow them to then be captured by the OpenTelemetry Configuration as well. Signed-off-by: Alex Boten --- specification/metrics/sdk_exporters/prometheus.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/specification/metrics/sdk_exporters/prometheus.md b/specification/metrics/sdk_exporters/prometheus.md index f72062e7c7a..1ffd623eb24 100644 --- a/specification/metrics/sdk_exporters/prometheus.md +++ b/specification/metrics/sdk_exporters/prometheus.md @@ -31,3 +31,7 @@ By default, it MUST NOT add any resource attributes as metric attributes. The configuration SHOULD allow the user to select which resource attributes to copy (e.g. include / exclude or regular expression based). Copied Resource attributes MUST NOT be excluded from target_info. + +A Prometheus Exporter MAY support a configuration option to produce metrics without a [unit suffix](../../compatibility/prometheus_and_openmetrics.md#metric-metadata). + +A Prometheus Exporter MAY support a configuration option to produce metrics without a [type suffix](../../compatibility/prometheus_and_openmetrics.md#metric-metadata). From a9d5a3e9d2c495072927885a7a775f3a5fa1d58b Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Mon, 27 Nov 2023 09:34:28 -0800 Subject: [PATCH 2/4] update changelog Signed-off-by: Alex Boten --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e206011501..860de0ab91c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ release. - Add optional configuration for Prometheus exporters to promote resource attributes to metric attributes ([#3761](https://github.com/open-telemetry/opentelemetry-specification/pull/3761)) +- Add optional configuration for Prometheus exporters to optionally remove unit and type suffixes + ([#3777](https://github.com/open-telemetry/opentelemetry-specification/pull/3777)) ### Logs From d78b5c3eca3642083c75fd6d0908cf067668a98e Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Tue, 28 Nov 2023 08:36:02 -0800 Subject: [PATCH 3/4] Update specification/metrics/sdk_exporters/prometheus.md Co-authored-by: David Ashpole --- specification/metrics/sdk_exporters/prometheus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/metrics/sdk_exporters/prometheus.md b/specification/metrics/sdk_exporters/prometheus.md index 1ffd623eb24..3d64c5e63b3 100644 --- a/specification/metrics/sdk_exporters/prometheus.md +++ b/specification/metrics/sdk_exporters/prometheus.md @@ -32,6 +32,6 @@ The configuration SHOULD allow the user to select which resource attributes to c include / exclude or regular expression based). Copied Resource attributes MUST NOT be excluded from target_info. -A Prometheus Exporter MAY support a configuration option to produce metrics without a [unit suffix](../../compatibility/prometheus_and_openmetrics.md#metric-metadata). +A Prometheus Exporter MAY support a configuration option to produce metrics without a [unit suffix](../../compatibility/prometheus_and_openmetrics.md#metric-metadata) or UNIT metadata. A Prometheus Exporter MAY support a configuration option to produce metrics without a [type suffix](../../compatibility/prometheus_and_openmetrics.md#metric-metadata). From a3b109c9c9584384eaec268f42680307667140f1 Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Fri, 1 Dec 2023 13:55:13 -0800 Subject: [PATCH 4/4] add option names and defaults Signed-off-by: Alex Boten --- specification/metrics/sdk_exporters/prometheus.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/specification/metrics/sdk_exporters/prometheus.md b/specification/metrics/sdk_exporters/prometheus.md index 3d64c5e63b3..e67df6f4d31 100644 --- a/specification/metrics/sdk_exporters/prometheus.md +++ b/specification/metrics/sdk_exporters/prometheus.md @@ -32,6 +32,8 @@ The configuration SHOULD allow the user to select which resource attributes to c include / exclude or regular expression based). Copied Resource attributes MUST NOT be excluded from target_info. -A Prometheus Exporter MAY support a configuration option to produce metrics without a [unit suffix](../../compatibility/prometheus_and_openmetrics.md#metric-metadata) or UNIT metadata. +A Prometheus Exporter MAY support a configuration option to produce metrics without a [unit suffix](../../compatibility/prometheus_and_openmetrics.md#metric-metadata) +or UNIT metadata. The option MAY be named `without_units`, and MUST be `false` by default. A Prometheus Exporter MAY support a configuration option to produce metrics without a [type suffix](../../compatibility/prometheus_and_openmetrics.md#metric-metadata). +The option MAY be named `without_type_suffix`, and MUST be `false` by default.