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)
tracing: {}
File (TOML)
[tracing]
CLI
--tracing=true
Common Options
addInternals
Optional, Default=”false”
Enables tracing for internal resources (e.g.: ping@internal
).
File (YAML)
tracing:
addInternals: true
File (TOML)
[tracing]
addInternals = true
CLI
--tracing.addinternals
serviceName
Required, Default=”traefik”
Service name used in selected backend.
File (YAML)
tracing:
serviceName: traefik
File (TOML)
[tracing]
serviceName = "traefik"
CLI
--tracing.serviceName=traefik
sampleRate
Optional, Default=1.0
The proportion of requests to trace, specified between 0.0 and 1.0.
File (YAML)
tracing:
sampleRate: 0.2
File (TOML)
[tracing]
sampleRate = 0.2
CLI
--tracing.sampleRate=0.2
globalAttributes
Optional, Default=empty
Applies a list of shared key:value attributes on all spans.
File (YAML)
tracing:
globalAttributes:
attr1: foo
attr2: bar
File (TOML)
[tracing]
[tracing.globalAttributes]
attr1 = "foo"
attr2 = "bar"
CLI
--tracing.globalAttributes.attr1=foo
--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)
tracing:
capturedRequestHeaders:
- X-CustomHeader
File (TOML)
[tracing]
capturedRequestHeaders = ["X-CustomHeader"]
CLI
--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)
tracing:
capturedResponseHeaders:
- X-CustomHeader
File (TOML)
[tracing]
capturedResponseHeaders = ["X-CustomHeader"]
CLI
--tracing.capturedResponseHeaders[0]=X-CustomHeader