2022-04-15 13:44:08 +00:00
|
|
|
---
|
|
|
|
title: "Traefik Tracing Overview"
|
|
|
|
description: "The Traefik Proxy tracing system allows developers to visualize call flows in their infrastructure. Read the full documentation."
|
|
|
|
---
|
|
|
|
|
2019-06-27 22:16:04 +00:00
|
|
|
# Tracing
|
|
|
|
|
|
|
|
Visualize the Requests Flow
|
|
|
|
{: .subtitle }
|
|
|
|
|
|
|
|
The tracing system allows developers to visualize call flows in their infrastructure.
|
|
|
|
|
2024-01-08 08:10:06 +00:00
|
|
|
Traefik uses [OpenTelemetry](https://opentelemetry.io/ "Link to website of OTel"), an open standard designed for distributed tracing.
|
2019-06-27 22:16:04 +00:00
|
|
|
|
2024-01-08 08:10:06 +00:00
|
|
|
Please check our dedicated [OTel docs](./opentelemetry.md) to learn more.
|
2019-06-27 22:16:04 +00:00
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
To enable the tracing:
|
|
|
|
|
2019-07-16 07:54:04 +00:00
|
|
|
```yaml tab="File (YAML)"
|
|
|
|
tracing: {}
|
|
|
|
```
|
|
|
|
|
2021-06-18 22:08:08 +00:00
|
|
|
```toml tab="File (TOML)"
|
|
|
|
[tracing]
|
|
|
|
```
|
|
|
|
|
2019-06-27 22:16:04 +00:00
|
|
|
```bash tab="CLI"
|
2019-07-22 07:58:04 +00:00
|
|
|
--tracing=true
|
2019-06-27 22:16:04 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Common Options
|
|
|
|
|
2024-01-30 15:28:05 +00:00
|
|
|
#### `addInternals`
|
|
|
|
|
|
|
|
_Optional, Default="false"_
|
|
|
|
|
2024-04-04 08:14:06 +00:00
|
|
|
Enables tracing for internal resources (e.g.: `ping@internal`).
|
2024-01-30 15:28:05 +00:00
|
|
|
|
|
|
|
```yaml tab="File (YAML)"
|
|
|
|
tracing:
|
|
|
|
addInternals: true
|
|
|
|
```
|
|
|
|
|
|
|
|
```toml tab="File (TOML)"
|
|
|
|
[tracing]
|
|
|
|
addInternals = true
|
|
|
|
```
|
|
|
|
|
|
|
|
```bash tab="CLI"
|
|
|
|
--tracing.addinternals
|
|
|
|
```
|
|
|
|
|
2019-06-27 22:16:04 +00:00
|
|
|
#### `serviceName`
|
|
|
|
|
|
|
|
_Required, Default="traefik"_
|
|
|
|
|
|
|
|
Service name used in selected backend.
|
|
|
|
|
2019-07-16 07:54:04 +00:00
|
|
|
```yaml tab="File (YAML)"
|
|
|
|
tracing:
|
|
|
|
serviceName: traefik
|
|
|
|
```
|
|
|
|
|
2021-06-18 22:08:08 +00:00
|
|
|
```toml tab="File (TOML)"
|
|
|
|
[tracing]
|
|
|
|
serviceName = "traefik"
|
|
|
|
```
|
|
|
|
|
2019-06-27 22:16:04 +00:00
|
|
|
```bash tab="CLI"
|
2019-11-19 09:18:05 +00:00
|
|
|
--tracing.serviceName=traefik
|
2019-06-27 22:16:04 +00:00
|
|
|
```
|
|
|
|
|
2024-01-08 08:10:06 +00:00
|
|
|
#### `sampleRate`
|
2019-06-27 22:16:04 +00:00
|
|
|
|
2024-01-08 08:10:06 +00:00
|
|
|
_Optional, Default=1.0_
|
2019-06-27 22:16:04 +00:00
|
|
|
|
2024-01-08 08:10:06 +00:00
|
|
|
The proportion of requests to trace, specified between 0.0 and 1.0.
|
2019-06-27 22:16:04 +00:00
|
|
|
|
2024-01-08 08:10:06 +00:00
|
|
|
```yaml tab="File (YAML)"
|
|
|
|
tracing:
|
|
|
|
sampleRate: 0.2
|
|
|
|
```
|
|
|
|
|
|
|
|
```toml tab="File (TOML)"
|
|
|
|
[tracing]
|
2024-09-03 12:02:03 +00:00
|
|
|
sampleRate = 0.2
|
2024-01-08 08:10:06 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```bash tab="CLI"
|
|
|
|
--tracing.sampleRate=0.2
|
|
|
|
```
|
|
|
|
|
|
|
|
#### `globalAttributes`
|
|
|
|
|
|
|
|
_Optional, Default=empty_
|
|
|
|
|
|
|
|
Applies a list of shared key:value attributes on all spans.
|
2019-06-27 22:16:04 +00:00
|
|
|
|
2019-07-16 07:54:04 +00:00
|
|
|
```yaml tab="File (YAML)"
|
|
|
|
tracing:
|
2024-01-08 08:10:06 +00:00
|
|
|
globalAttributes:
|
|
|
|
attr1: foo
|
|
|
|
attr2: bar
|
2019-07-16 07:54:04 +00:00
|
|
|
```
|
|
|
|
|
2021-06-18 22:08:08 +00:00
|
|
|
```toml tab="File (TOML)"
|
|
|
|
[tracing]
|
2024-09-03 12:02:03 +00:00
|
|
|
[tracing.globalAttributes]
|
|
|
|
attr1 = "foo"
|
|
|
|
attr2 = "bar"
|
2021-06-18 22:08:08 +00:00
|
|
|
```
|
|
|
|
|
2019-06-27 22:16:04 +00:00
|
|
|
```bash tab="CLI"
|
2024-01-08 08:10:06 +00:00
|
|
|
--tracing.globalAttributes.attr1=foo
|
|
|
|
--tracing.globalAttributes.attr2=bar
|
2019-06-27 22:16:04 +00:00
|
|
|
```
|
2024-03-11 10:50:04 +00:00
|
|
|
|
|
|
|
#### `capturedRequestHeaders`
|
|
|
|
|
|
|
|
_Optional, Default=empty_
|
|
|
|
|
|
|
|
Defines the list of request headers to add as attributes.
|
|
|
|
It applies to client and server kind spans.
|
|
|
|
|
|
|
|
```yaml tab="File (YAML)"
|
|
|
|
tracing:
|
|
|
|
capturedRequestHeaders:
|
|
|
|
- X-CustomHeader
|
|
|
|
```
|
|
|
|
|
|
|
|
```toml tab="File (TOML)"
|
|
|
|
[tracing]
|
2024-09-03 12:02:03 +00:00
|
|
|
capturedRequestHeaders = ["X-CustomHeader"]
|
2024-03-11 10:50:04 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```bash tab="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.
|
|
|
|
|
|
|
|
```yaml tab="File (YAML)"
|
|
|
|
tracing:
|
|
|
|
capturedResponseHeaders:
|
|
|
|
- X-CustomHeader
|
|
|
|
```
|
|
|
|
|
|
|
|
```toml tab="File (TOML)"
|
|
|
|
[tracing]
|
2024-09-03 12:02:03 +00:00
|
|
|
capturedResponseHeaders = ["X-CustomHeader"]
|
2024-03-11 10:50:04 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```bash tab="CLI"
|
|
|
|
--tracing.capturedResponseHeaders[0]=X-CustomHeader
|
2024-04-04 08:14:06 +00:00
|
|
|
```
|
2024-06-27 12:14:03 +00:00
|
|
|
|
|
|
|
#### `safeQueryParams`
|
|
|
|
|
|
|
|
_Optional, Default={}_
|
|
|
|
|
|
|
|
By default, all query parameters are redacted.
|
|
|
|
Defines the list of query parameters to not redact.
|
|
|
|
|
|
|
|
```yaml tab="File (YAML)"
|
|
|
|
tracing:
|
2024-09-03 12:02:03 +00:00
|
|
|
safeQueryParams:
|
|
|
|
- bar
|
|
|
|
- buz
|
2024-06-27 12:14:03 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```toml tab="File (TOML)"
|
|
|
|
[tracing]
|
2024-09-03 12:02:03 +00:00
|
|
|
safeQueryParams = ["bar", "buz"]
|
2024-06-27 12:14:03 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```bash tab="CLI"
|
2024-08-29 12:30:05 +00:00
|
|
|
--tracing.safeQueryParams=bar,buz
|
2024-06-27 12:14:03 +00:00
|
|
|
```
|