Menu

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Open source

Configure the OpenTelemetry Collector to write metrics into Mimir

When using the OpenTelemetry Collector, 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.

Remote Write

For the Remote Write, use the prometheusremotewrite 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 basicauth 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]

OTLP

Mimir supports native OTLP over HTTP. To configure the collector to use the OTLP interface, you use the otlphttp 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 basicauth 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]