Project: Grafana Mimir (Observability and Analysis / Observability)
File: configure-otel-collector.md

aliases: ../operators-guide/configure/configure-otel-collector/ description: Learn how to write metrics from OpenTelemetry Collector into Mimir menuTitle: OpenTelemetry Collector title: Configure the OpenTelemetry Collector to write metrics into Mimir weight: 150 {{% admonition type="note" %}} To send OTLP data to Grafana Cloud, refer to . {{% /admonition %}} When using the , you can write metrics into Mimir via two options: `prometheusremotewrite` and `otlphttp`. We recommend using the `prometheusremotewrite` exporter when possible because the remote write ingest path is tested and proven at scale. For the Remote Write, use the exporter in the Collector: In the `exporters` section add: ```yaml exporters: prometheusremotewrite: endpoint: http://<mimir-endpoint>/api/v1/push ``` And enable it in the `service.pipelines`: ```yaml service: pipelines: metrics: receivers: [...] processors: [...] exporters: [..., prometheusremotewrite] ``` If you want to authenticate using basic auth, we recommend the extension: ```yaml extensions: basicauth/prw: client_auth: username: username password: password exporters: prometheusremotewrite: auth: authenticator: basicauth/prw endpoint: http://<mimir-endpoint>/api/v1/push service: extensions: [basicauth/prw] pipelines: metrics: receivers: [...] processors: [...] exporters: [..., prometheusremotewrite] ``` Mimir supports native OTLP over HTTP. To configure the collector to use the OTLP interface, you use the exporter: ```yaml exporters: otlphttp: endpoint: http://<mimir-endpoint>/otlp ``` And enable it in `service.pipelines`: ```yaml service: pipelines: metrics: receivers: [...] processors: [...] exporters: [..., otlphttp] ``` If you want to authenticate using basic auth, we recommend the extension: ```yaml extensions: basicauth/otlp: client_auth: username: username password: password exporters: otlphttp: auth: authenticator: basicauth/otlp endpoint: http://<mimir-endpoint>/otlp service: extensions: [basicauth/otlp] pipelines: metrics: receivers: [...] processors: [...] exporters: [..., otlphttp] ``` We follow the official specification. By default, Grafana Mimir does not accept metrics. For Grafana Mimir to accept them, ingestion of Prometheus Native Histogram metrics must first be enabled following the instructions in . After this is done, Grafana Mimir will accept OpenTelemetry Exponential Histograms, and convert them into Prometheus Native Histograms following the conventions described in the . You might experience the following common issues: Dots (.) are converted to \_ Prometheus metrics do not support `.` and `-` characters in metric or label names. Prometheus converts these characters to `_`. For example: `requests.duration{http.status_code=500, cloud.region=us-central1}` in OTLP `requestsduration{httpstatuscode=500, cloudregion=us-central1}` in Prometheus Resource attributes are added to the `target_info` metric. However, `<service.namespace>/<service.name>` or `<service.name>` (if the namespace is empty), is added as the label `job`, and `service.instance.id` is added as the label `instance` to every metric. For details, see the specification.