> ## Documentation Index
> Fetch the complete documentation index at: https://axiom.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Send Traefik metrics to Axiom

> This page explains how to send Traefik metrics to Axiom using the Prometheus receiver of the OpenTelemetry Collector.

Traefik exposes detailed metrics about its entrypoints, routers, and services in Prometheus format. Axiom ingests metrics over OTLP and doesn’t accept Prometheus remote-write, so the recommended setup is an OpenTelemetry Collector that scrapes Traefik’s Prometheus endpoint and forwards the metrics to Axiom. The same pattern works for any app that exposes Prometheus metrics.

<Note>
  The Prometheus receiver is part of the [contrib distribution](https://github.com/open-telemetry/opentelemetry-collector-releases) of the OpenTelemetry Collector (`otelcol-contrib`). It isn’t included in the core distribution.
</Note>

## Prerequisites

* [Create an Axiom account](https://app.axiom.co/register).
* [Create a dataset in Axiom](/docs/reference/datasets#create-dataset) where you send your data.
* [Create an API token in Axiom](/docs/reference/tokens) with permissions to ingest data to the dataset you have created.

<Note>
  When you create the dataset, select **Metrics** as the dataset type. Metrics require their own dedicated dataset. For more information, see [Create dataset](/docs/reference/datasets#create-dataset).
</Note>

## Enable Prometheus metrics in Traefik

Enable the Prometheus metrics provider in Traefik’s static configuration:

```yaml theme={null}
metrics:
  prometheus:
    addEntryPointsLabels: true
    addServicesLabels: true
```

Traefik then serves metrics at `/metrics` on the internal `traefik` entrypoint (port 8080 by default). To add per-router metrics, set `addRoutersLabels: true` as well. For all options, see the [Traefik documentation](https://doc.traefik.io/traefik/reference/install-configuration/observability/metrics/).

## Configure the OpenTelemetry Collector

Add a Prometheus receiver that scrapes Traefik and an OTLP/HTTP exporter that sends data to Axiom:

```yaml theme={null}
receivers:
  prometheus:
    config:
      scrape_configs:
        - job_name: traefik
          scrape_interval: 15s
          static_configs:
            - targets: ["traefik:8080"] # host:port of Traefik's metrics entrypoint

processors:
  memory_limiter:
    check_interval: 1s
    limit_percentage: 80
    spike_limit_percentage: 25
  batch:
    send_batch_max_size: 8192

exporters:
  otlphttp:
    compression: zstd
    endpoint: https://AXIOM_DOMAIN
    headers:
      authorization: Bearer API_TOKEN
      x-axiom-metrics-dataset: DATASET_NAME

service:
  pipelines:
    metrics:
      receivers:
        - prometheus
      processors:
        - memory_limiter
        - batch
      exporters:
        - otlphttp
```

<Info>
  Replace `AXIOM_DOMAIN` with the base domain of your edge deployment. For more information, see [Edge deployments](/docs/reference/edge-deployments).

  Replace `API_TOKEN` with the Axiom API token you have generated. For added security, store the API token in an environment variable.

  Replace `DATASET_NAME` with the name of the Axiom dataset where you send your data.

  For metrics, use the `x-axiom-metrics-dataset` header instead of `x-axiom-dataset`.
</Info>

<Note>
  Traefik v3 can also push OTLP metrics directly (`metrics.otlp`) — for example, to the OTLP receiver of an OpenTelemetry Collector that forwards to Axiom as shown above. For more information, see the [Traefik documentation](https://doc.traefik.io/traefik/reference/install-configuration/observability/metrics/).
</Note>

## Query your metrics

Once data is flowing, query your Traefik metrics like any other OTel metrics in Axiom. For example, to chart the request rate per service:

```mpl theme={null}
`DATASET_NAME`:`traefik_service_requests_total`
| align to $__interval using prom::rate
| group by `service` using sum
```

For more information, see [Metrics](/docs/query-data/metrics).
