Prometheus Exporter
core, contrib
Maintainers: @Aneurysm9, @dashpole, @ArthurSens
Source: opentelemetry-collector-contrib
Supported Telemetry
Overview
Exports data in the Prometheus format, which allows it to be scraped by a Prometheus server.Getting Started
The following settings are required:endpoint(no default): the address on which metrics will be exposed, using path/metrics. For more info, see the full list ofServerConfigoptions.
const_labels(no default): key/values that are applied for every exported metric.namespace(no default): if set, exports metrics under the provided value.send_timestamps(default =false): if true, sends the timestamp of the underlying metric sample in the response.metric_expiration(default =5m): defines how long metrics are exposed without updatesresource_to_telemetry_conversionenabled(default = false): Ifenabledistrue, all the resource attributes will be converted to metric labels by default.
enable_open_metrics: (default =false): If true, metrics will be exported using the OpenMetrics format. Exemplars are only exported in the OpenMetrics format, and only for histogram and monotonic sum (i.e. counter) metrics.without_scope_info: (default =false): If true, metrics will be exported without scope name, version, schemaURL, and attributes encoded as labels.add_metric_suffixes: (default =true): If false, addition of type and unit suffixes is disabled. Deprecated: Usetranslation_strategyinstead. This setting is ignored whentranslation_strategyis explicitly set.translation_strategy: Controls how OTLP metric and attribute names are translated into Prometheus metric and label names. When set, this takes precedence overadd_metric_suffixes. Available options:UnderscoreEscapingWithSuffixes: Fully escapes metric names for classic Prometheus metric name compatibility, and includes appending type and unit suffixes.UnderscoreEscapingWithoutSuffixes: Metric names will continue to escape special characters to_, but suffixes won’t be attached.NoUTF8EscapingWithSuffixes: Disables changing special characters to_. Special suffixes like units and_totalfor counters will be attached.NoTranslation: Bypasses all metric and label name translation, passing them through unaltered.
https://1.2.3.4:1234/metrics.
Feature gates
There are also flags that control translation behavior. See the documentation for the Prometheus translator module for more information.Metric names and labels normalization
By Default, OpenTelemetry metric names and attributes are normalized to be compliant with Prometheus naming rules. Optionally, users can set differenttranslation_strategy options to control how metrics are exposed. Please be aware that Prometheus itself uses content negotiation to decide how to ingest metrics, and underscore escaping might be applied even though this exporter is configured to keep UTF-8 characters. For more details, read Prometheus’ Content Negotiation documentation.
Setting resource attributes as metric labels
By default, resource attributes are added to a special metric calledtarget_info. To select and group by metrics by resource attributes, you need to do join on target_info. For example, to select metrics with k8s_namespace_name attribute equal to my-namespace:
k8s_namespace_name):
Configuration
Example Configuration
Last generated: 2026-04-13