Tracing

Visualize the Requests Flow

The tracing system allows developers to visualize call flows in their infrastructure.

Traefik uses OpenTelemetry, an open standard designed for distributed tracing.

Please check our dedicated OTel docs to learn more.

Configuration

To enable the tracing:

File (YAML)

  1. tracing: {}

File (TOML)

  1. [tracing]

CLI

  1. --tracing=true

Common Options

addInternals

Optional, Default=”false”

Enables tracing for internal resources (e.g.: ping@internal).

File (YAML)

  1. tracing:
  2. addInternals: true

File (TOML)

  1. [tracing]
  2. addInternals = true

CLI

  1. --tracing.addinternals

serviceName

Required, Default=”traefik”

Service name used in selected backend.

File (YAML)

  1. tracing:
  2. serviceName: traefik

File (TOML)

  1. [tracing]
  2. serviceName = "traefik"

CLI

  1. --tracing.serviceName=traefik

sampleRate

Optional, Default=1.0

The proportion of requests to trace, specified between 0.0 and 1.0.

File (YAML)

  1. tracing:
  2. sampleRate: 0.2

File (TOML)

  1. [tracing]
  2. sampleRate = 0.2

CLI

  1. --tracing.sampleRate=0.2

globalAttributes

Optional, Default=empty

Applies a list of shared key:value attributes on all spans.

File (YAML)

  1. tracing:
  2. globalAttributes:
  3. attr1: foo
  4. attr2: bar

File (TOML)

  1. [tracing]
  2. [tracing.globalAttributes]
  3. attr1 = "foo"
  4. attr2 = "bar"

CLI

  1. --tracing.globalAttributes.attr1=foo
  2. --tracing.globalAttributes.attr2=bar

capturedRequestHeaders

Optional, Default=empty

Defines the list of request headers to add as attributes. It applies to client and server kind spans.

File (YAML)

  1. tracing:
  2. capturedRequestHeaders:
  3. - X-CustomHeader

File (TOML)

  1. [tracing]
  2. capturedRequestHeaders = ["X-CustomHeader"]

CLI

  1. --tracing.capturedRequestHeaders[0]=X-CustomHeader

capturedResponseHeaders

Optional, Default=empty

Defines the list of response headers to add as attributes. It applies to client and server kind spans.

File (YAML)

  1. tracing:
  2. capturedResponseHeaders:
  3. - X-CustomHeader

File (TOML)

  1. [tracing]
  2. capturedResponseHeaders = ["X-CustomHeader"]

CLI

  1. --tracing.capturedResponseHeaders[0]=X-CustomHeader

safeQueryParams

Optional, Default={}

By default, all query parameters are redacted. Defines the list of query parameters to not redact.

File (YAML)

  1. tracing:
  2. otlp:
  3. safeQueryParams:
  4. - bar
  5. - buz

File (TOML)

  1. [tracing]
  2. [tracing.otlp]
  3. safeQueryParams = ["bar", "buz"]

CLI

  1. --tracing.otlp.safeQueryParams=bar,buz