traefik/docs/content/observability/tracing/overview.md

186 lines
3.1 KiB
Markdown
Raw Normal View History

---
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: {}
```
```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
#### `addInternals`
_Optional, Default="false"_
Enables tracing for internal resources (e.g.: `ping@internal`).
```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
```
```toml tab="File (TOML)"
[tracing]
serviceName = "traefik"
```
2019-06-27 22:16:04 +00:00
```bash tab="CLI"
--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
```
```toml tab="File (TOML)"
[tracing]
2024-09-03 12:02:03 +00:00
[tracing.globalAttributes]
attr1 = "foo"
attr2 = "bar"
```
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
```
#### `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"]
```
```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"]
```
```bash tab="CLI"
--tracing.capturedResponseHeaders[0]=X-CustomHeader
```
#### `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
```
```toml tab="File (TOML)"
[tracing]
2024-09-03 12:02:03 +00:00
safeQueryParams = ["bar", "buz"]
```
```bash tab="CLI"
2024-08-29 12:30:05 +00:00
--tracing.safeQueryParams=bar,buz
```