Metrics Exporter - Prometheus

Status: Experimental

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

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

A Prometheus Exporter SHOULD use Prometheus client libraries for serving Prometheus metrics. 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.

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 MUST NOT add explicit timestamps on Metric points.

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

Configuration

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. include / exclude or regular expression based). Copied Resource attributes MUST NOT be excluded from the target info metric.

A Prometheus Exporter MAY support a configuration option to produce metrics without a unit suffix or UNIT metadata. The option MAY be named without_units, and MUST be false by default.

A Prometheus Exporter MAY support a configuration option to produce metrics without a type suffix. The option MAY be named without_type_suffix, and MUST be false by default.

A Prometheus Exporter MAY support a configuration option to produce metrics without a scope info metric, or scope labels. The option MAY be named without_scope_info, and MUST be false by default.

A Prometheus Exporter MAY support a configuration option to produce metrics without a target info metric. The option MAY be named without_target_info, and MUST be false by default.