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

125 lines
2 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
#### `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]
sampleRate = 0.2
```
```bash tab="CLI"
--tracing.sampleRate=0.2
```
#### `headers`
_Optional, Default={}_
Defines additional headers to be sent with the span's payload.
```yaml tab="File (YAML)"
tracing:
headers:
foo: bar
baz: buz
```
```toml tab="File (TOML)"
[tracing]
[tracing.headers]
foo = "bar"
baz = "buz"
```
```bash tab="CLI"
--tracing.headers.foo=bar --tracing.headers.baz=buz
```
#### `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-01-08 08:10:06 +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
```