diff --git a/CHANGELOG.md b/CHANGELOG.md index 69c7451bbd0..ca61ae7cbf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,8 @@ release. ([#2038](https://github.com/open-telemetry/opentelemetry-specification/pull/2038)) - Specify that the SDK must support exporters to access meter information. ([#2040](https://github.com/open-telemetry/opentelemetry-specification/pull/2040)) +- Define how Prometheus should handle Meter attributes. + ([#2035](https://github.com/open-telemetry/opentelemetry-specification/pull/2035)) ### Logs diff --git a/specification/metrics/sdk_exporters/prometheus.md b/specification/metrics/sdk_exporters/prometheus.md index 4edcf3625b2..8c8fb885797 100644 --- a/specification/metrics/sdk_exporters/prometheus.md +++ b/specification/metrics/sdk_exporters/prometheus.md @@ -5,3 +5,10 @@ Prometheus Exporter is a [Pull Metric Exporter](../sdk.md#pull-metric-exporter) which reacts to the Prometheus scraper and report the metrics passively to [Prometheus](https://prometheus.io/). + +Prometheus Exporter MUST export Meter `name` and `version` information when +enabled by the [Metrics SDK Configuration](../../sdk-environment-variables.md#metrics-sdk-configuration). +The Prometheus Exporter MUST respect the configuration preferences of the application +provide a method to configure whether these data are exported as +[Attributes](../common/common.md#attributes). The `name` and `version` information +will follow the same naming as [trace exporters.](../../trace/sdk_exporters/non-otlp.md#instrumentationlibrary) diff --git a/specification/sdk-environment-variables.md b/specification/sdk-environment-variables.md index 2e1a9bfe57f..16df1876f60 100644 --- a/specification/sdk-environment-variables.md +++ b/specification/sdk-environment-variables.md @@ -149,8 +149,14 @@ thrift or protobuf. As of 1.0 of the specification, there | Name | Description | Default | | ----------------------------- | --------------------------------| ---------------------------- | -| OTEL_EXPORTER_PROMETHEUS_HOST | Host used by the Prometheus exporter | All addresses: "0.0.0.0"| -| OTEL_EXPORTER_PROMETHEUS_PORT | Port used by the Prometheus exporter | 9464 | +| `OTEL_EXPORTER_PROMETHEUS_HOST` | Host used by the Prometheus exporter | All addresses: "0.0.0.0"| +| `OTEL_EXPORTER_PROMETHEUS_PORT` | Port used by the Prometheus exporter | 9464 | +| `OTEL_EXPORTER_PROMETHEUS_LIBRARY_ATTRIBUTES` | Filter for if `name` and `version` from [Meter](./metrics/api.md#get-a-meter) are exported. | `false` | | + +Known values for `OTEL_EXPORTER_PROMETHEUS_LIBRARY_ATTRIBUTES` are: + +- `true` : Add the Meter `name` and `version` as Attributes on the metrics exported. +- `false` : Don't add Meter `name` and `version` as Attributes on the metrics exported. ## Exporter Selection