Documentation Index
Fetch the complete documentation index at: https://mintlify.com/traefik/traefik/llms.txt
Use this file to discover all available pages before exploring further.
Distributed Tracing
Distributed tracing provides end-to-end visibility into request flows across your infrastructure. Traefik uses OpenTelemetry, an open standard for distributed tracing compatible with Jaeger, Zipkin, and other tracing backends.Overview
Tracing allows you to:- Visualize request propagation across services
- Identify performance bottlenecks
- Analyze latency distribution
- Track errors through the request lifecycle
- Understand service dependencies
Quick Start
Enable basic tracing:https://localhost:4318/v1/traces.
Common Configuration
Service Name
Service name identifier in the tracing backend.
Sample Rate
Proportion of requests to trace (0.0 to 1.0).
0.1 to trace 10% of requests:
The OpenTelemetry SDK also supports the
OTEL_TRACES_SAMPLER environment variable for custom sampling strategies.Add Internals
Enable tracing for internal resources like
ping@internal.Resource Attributes
Additional resource attributes sent to the collector.
Captured Headers
Capture request and response headers as span attributes:List of request headers to add as span attributes.
List of response headers to add as span attributes.
Safe Query Parameters
Query parameters to NOT redact (all others are redacted by default).
OpenTelemetry Configuration
HTTP Protocol
Send traces via HTTP to an OpenTelemetry Collector:HTTP Configuration Options
URL of the OpenTelemetry Collector.
To disable TLS, use
http:// instead of https:// in the endpoint URL.Additional headers sent with traces.
Path to certificate authority file.
Path to client certificate file.
Path to client private key file.
Skip TLS certificate verification.
gRPC Protocol
Send traces via gRPC to an OpenTelemetry Collector:gRPC Configuration Options
Address of the OpenTelemetry Collector (format:
host:port).Send traces without using a secured protocol.
Additional headers sent with traces.
Trace Propagation
Traefik supports multiple trace context propagation formats via theOTEL_PROPAGATORS environment variable:
tracecontext(default) - W3C Trace Contextbaggage(default) - W3C Baggageb3- B3 single headerb3multi- B3 multi headerjaeger- Jaeger propagationxray- AWS X-Rayottrace- OT Trace
Configure Propagators
Set multiple propagators:Backend Integration Examples
Jaeger
Connect to Jaeger via OpenTelemetry Collector:Zipkin
Connect to Zipkin via OpenTelemetry Collector:AWS X-Ray
Configure for AWS X-Ray:Complete Examples
Production Tracing Setup
Development Setup
Docker Compose with Jaeger
http://localhost:16686.
Span Attributes
Traefik creates spans with OpenTelemetry semantic conventions:HTTP Span Attributes
http.request.method- HTTP method (GET, POST, etc.)http.response.status_code- HTTP status codenetwork.protocol.name- Protocol name (http/1.1, h2, etc.)server.address- Server hostnameserver.port- Server porturl.scheme- URL scheme (http, https)url.path- Request pathuser_agent.original- User-Agent header
Traefik-Specific Attributes
traefik.router.name- Router that handled the requesttraefik.service.name- Service that handled the requesttraefik.entrypoint.name- EntryPoint that received the request
Best Practices
Performance Optimization
- Use sampling (e.g.,
sampleRate: 0.1) in high-traffic environments - Avoid capturing large headers or sensitive data
- Monitor collector resource usage
Security
- Redact sensitive query parameters (default behavior)
- Use TLS for collector connections in production
- Avoid capturing Authorization headers unless necessary
- Secure the collector endpoint with authentication
Troubleshooting
- Verify collector connectivity with
--log.level=DEBUG - Check trace sampling configuration
- Validate propagation headers in requests
- Monitor collector for errors