Skip to content

Commit

Permalink
Make prometheus host and port config options explicit (#4147)
Browse files Browse the repository at this point in the history
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 <pellared@hotmail.com>
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
  • Loading branch information
3 people committed Jul 23, 2024
1 parent a1d20b9 commit b1c4e78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions specification/metrics/sdk_exporters/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b1c4e78

Please sign in to comment.