Status | |
---|---|
Stability | beta |
Supported pipeline types | metrics |
Distributions | core, contrib |
Prometheus Remote Write Exporter sends OpenTelemetry metrics to Prometheus remote write compatible backends such as Cortex, Mimir, and Thanos. By default, this exporter requires TLS and offers queued retry capabilities.
A design doc is available to document in detail how this exporter works.
The following settings are required:
endpoint
(no default): The remote write URL to send remote write samples.
By default, TLS is enabled and must be configured under tls:
:
insecure
(default =false
): whether to enable client transport security for the exporter's connection.
As a result, the following parameters are also required under tls:
:
cert_file
(no default): path to the TLS cert to use for TLS required connections. Should only be used ifinsecure
is set to false.key_file
(no default): path to the TLS key to use for TLS required connections. Should only be used ifinsecure
is set to false.
The following settings can be optionally configured:
external_labels
: map of labels names and values to be attached to each metric data pointheaders
: additional headers attached to each HTTP request.- Note the following headers cannot be changed:
Content-Encoding
,Content-Type
,X-Prometheus-Remote-Write-Version
, andUser-Agent
.
- Note the following headers cannot be changed:
namespace
: prefix attached to each exported metric name.remote_write_queue
: fine tuning for queueing and sending of the outgoing remote writes.enabled
: enable the sending queuequeue_size
: number of OTLP metrics that can be queued. Ignored ifenabled
isfalse
num_consumers
: minimum number of workers to use to fan out the outgoing requests.
resource_to_telemetry_conversion
enabled
(default = false): Ifenabled
istrue
, all the resource attributes will be converted to metric labels by default.
target_info
: customizetarget_info
metricenabled
(default = true): Ifenabled
istrue
, atarget_info
metric will be generated for each resource metric (see open-telemetry/opentelemetry-specification#2381).
Example:
exporters:
prometheusremotewrite:
endpoint: "https://my-cortex:7900/api/v1/push"
wal: # Enabling the Write-Ahead-Log for the exporter.
directory: ./prom_rw # The directory to store the WAL in
buffer_size: 100 # Optional count of elements to be read from the WAL before truncating; default of 300
truncate_frequency: 45s # Optional frequency for how often the WAL should be truncated. It is a time.ParseDuration; default of 1m
resource_to_telemetry_conversion:
enabled: true # Convert resource attributes to metric labels
Example:
exporters:
prometheusremotewrite:
endpoint: "https://my-cortex:7900/api/v1/push"
external_labels:
label_name1: label_value1
label_name2: label_value2
Several helper files are leveraged to provide additional capabilities automatically:
- HTTP settings
- TLS and mTLS settings
- Retry and timeout settings, note that the exporter doesn't support
sending_queue
but providesremote_write_queue
.
OpenTelemetry metric names and attributes are normalized to be compliant with Prometheus naming rules. Details on this normalization process are described in the Prometheus translator module.