Metrics Exporter - Prometheus

Status: Mixed

Prometheus Exporter Model

Pull Metric Exporter

Status: Development

A Prometheus Exporter MUST be a Pull Metric Exporter which responds to HTTP requests with Prometheus metrics in the appropriate format.

Metric Conversion

Status: Development

OpenTelemetry metrics MUST be converted to Prometheus metrics according to the Prometheus Compatibility specification.

Client Libraries

Status: Stable

A Prometheus Exporter SHOULD use an official Prometheus client library when one exists for the implementation language and it is practical to do so (e.g., dependency concerns) for serving Prometheus metrics; it SHOULD NOT use an unofficial Prometheus client library. This allows the Prometheus client to negotiate the format 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 so it can be used in conjunction with existing Prometheus instrumentation.

Version and Format

Status: Stable

Regardless of whether a Prometheus client library is used, the Prometheus Exporter MUST support version 0.0.4 of the Text-based format. A Prometheus Exporter MAY support Exemplars and Exponential Histograms, which are not currently supported by the Prometheus text format, by supporting other Protocols, but is not required to implement them.

A Prometheus Exporter for an OpenTelemetry metrics SDK MUST NOT use Prometheus Remote Write format or OpenMetrics protobuf format.

A Prometheus Exporter for an OpenTelemetry metrics SDK SHOULD NOT add explicit timestamps on Metric points.

SDK Metric Output

Target

Status: Stable

There MUST be at most one target info metric exposed by an SDK Prometheus exporter.

Temporality

Status: Stable

A Prometheus Exporter MUST set the MetricReader temporality as a function of instrument kind to be cumulative for all instrument kinds.

Configuration

Host

Status: Stable

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.

Port

Status: Stable

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.

Default Aggregation

Status: Stable

A Prometheus Exporter SHOULD support a configuration option to set the MetricReader default aggregation as a function of instrument kind. This option MAY be named default_aggregation, and MUST use the default aggregation by default.

Resource Attributes as Metric Labels