From b1c4e7838c8aa5d976d69d2614cfb527e3490a76 Mon Sep 17 00:00:00 2001 From: jack-berg <34418638+jack-berg@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:11:49 -0500 Subject: [PATCH] Make prometheus host and port config options explicit (#4147) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Splitting off a portion of #4142. This PR makes the host and port configuration options explicit for the prometheus exporter. Currently, they're [implied from the corresponding env vars](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#prometheus-exporter) `OTEL_EXPORTER_PROMETHEUS_HOST` and `OTEL_EXPORTER_PROMETHEUS_PORT`. See this [convo](https://github.com/open-telemetry/opentelemetry-specification/pull/4142/files#r1674675871) for more details. --------- Co-authored-by: Robert PajÄ…k Co-authored-by: Trask Stalnaker --- CHANGELOG.md | 3 +++ specification/metrics/sdk_exporters/prometheus.md | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdfd619f89b..6b6f36a8bae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ release. ### Metrics +- Clarify prometheus exporter should have `host` and `port` configuration options. + ([#4147](https://github.com/open-telemetry/opentelemetry-specification/pull/4147)) + ### Logs ### Events diff --git a/specification/metrics/sdk_exporters/prometheus.md b/specification/metrics/sdk_exporters/prometheus.md index d824971bc53..844e88ef40f 100644 --- a/specification/metrics/sdk_exporters/prometheus.md +++ b/specification/metrics/sdk_exporters/prometheus.md @@ -40,6 +40,14 @@ Prometheus exporter. ## Configuration +A Prometheus Exporter SHOULD support a configuration option to set the host +that metrics are served on. The option MAY be named `host`, and MUST be `localhost` +by default. + +A Prometheus Exporter SHOULD support a configuration option to set the port +that metrics are served on. The option MAY be named `port`, and MUST be `9464` by +default. + A Prometheus Exporter MAY offer configuration to add resource attributes as metric attributes. 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.