Skip to content

Commit

Permalink
prometheus exporter SHOULD be modeled as a Collector
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Mar 14, 2024
1 parent 54774b6 commit 45c2ae0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions specification/metrics/sdk_exporters/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ OpenTelemetry metrics MUST be converted to Prometheus metrics according to the

A Prometheus Exporter SHOULD use
[Prometheus client libraries](https://prometheus.io/docs/instrumenting/clientlibs/)
for serving Prometheus metrics, including negotiating the
[format](https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#openmetrics-text-format)
of the response using the Content-Type header. Regardless of whether a
Prometheus client library is used, the Prometheus Exporter MUST support version
`0.0.4` of the [Text-based format](https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#text-based-format).
for serving Prometheus metrics. This allows the prometheus client to negotiate
the [format](https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md)
of the response using the `Content-Type` header. If a prometheus client library
is used, the OpenTelemetry Prometheus Exporter SHOULD be modeled as a
[custom Collector](https://prometheus.io/docs/instrumenting/writing_clientlibs/#overall-structure)
so it can be used in conjunction with existing Prometheus instrumentation.

Regardless of whether a Prometheus client library is used, the Prometheus
Exporter MUST support version `0.0.4` of the
[Text-based format](https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#text-based-format).
A Prometheus Exporter MAY support Exemplars and Exponential Histograms,
which are [not currently supported by the Prometheus text format](../../compatibility/prometheus_and_openmetrics.md#differences-between-prometheus-formats),
by supporting other Prococols, but is not required to implement them.
Expand Down

0 comments on commit 45c2ae0

Please sign in to comment.