Skip to content

Commit b1c4e78

Browse files
jack-bergpellaredtrask
authored
Make prometheus host and port config options explicit (#4147)
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 <[email protected]> Co-authored-by: Trask Stalnaker <[email protected]>
1 parent a1d20b9 commit b1c4e78

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ release.
1616

1717
### Metrics
1818

19+
- Clarify prometheus exporter should have `host` and `port` configuration options.
20+
([#4147](https://github.com/open-telemetry/opentelemetry-specification/pull/4147))
21+
1922
### Logs
2023

2124
### Events

specification/metrics/sdk_exporters/prometheus.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ Prometheus exporter.
4040

4141
## Configuration
4242

43+
A Prometheus Exporter SHOULD support a configuration option to set the host
44+
that metrics are served on. The option MAY be named `host`, and MUST be `localhost`
45+
by default.
46+
47+
A Prometheus Exporter SHOULD support a configuration option to set the port
48+
that metrics are served on. The option MAY be named `port`, and MUST be `9464` by
49+
default.
50+
4351
A Prometheus Exporter MAY offer configuration to add resource attributes as metric attributes.
4452
By default, it MUST NOT add any resource attributes as metric attributes.
4553
The configuration SHOULD allow the user to select which resource attributes to copy (e.g.

0 commit comments

Comments
 (0)