From cb03f1d7f70f7b63409bcef94d52a265ff8e95eb Mon Sep 17 00:00:00 2001 From: Alex Boten Date: Wed, 13 Dec 2023 10:17:18 -0800 Subject: [PATCH] add optional configuration for prometheus exporter (#3777) ## Changes 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. * [x] Related issues https://github.com/open-telemetry/opentelemetry-configuration/issues/59 --- CHANGELOG.md | 2 ++ specification/metrics/sdk_exporters/prometheus.md | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4652355fdb..daba7b5387e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,8 @@ release. ([#3761](https://github.com/open-telemetry/opentelemetry-specification/pull/3761)) - Clarifications and flexibility in Exemplar speicification. ([#3760](https://github.com/open-telemetry/opentelemetry-specification/pull/3760)) +- Add optional configuration for Prometheus exporters to optionally remove unit and type suffixes + ([#3777](https://github.com/open-telemetry/opentelemetry-specification/pull/3777)) ### Logs diff --git a/specification/metrics/sdk_exporters/prometheus.md b/specification/metrics/sdk_exporters/prometheus.md index f72062e7c7a..e67df6f4d31 100644 --- a/specification/metrics/sdk_exporters/prometheus.md +++ b/specification/metrics/sdk_exporters/prometheus.md @@ -31,3 +31,9 @@ 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) +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.