From 45c2ae0325d185f902eb40c143da05f0dc9564b2 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Fri, 9 Feb 2024 14:49:06 +0000 Subject: [PATCH] prometheus exporter SHOULD be modeled as a Collector --- specification/metrics/sdk_exporters/prometheus.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/specification/metrics/sdk_exporters/prometheus.md b/specification/metrics/sdk_exporters/prometheus.md index 26ed20d1f22..7843d6e7333 100644 --- a/specification/metrics/sdk_exporters/prometheus.md +++ b/specification/metrics/sdk_exporters/prometheus.md @@ -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.