Merge pull request #10854 from austinvazquez/update-tracing-docs-for-containerd-2.0

Update tracing docs for containerd 2.0
This commit is contained in:
Derek McGowan 2024-10-18 15:38:20 +00:00 committed by GitHub
commit b291eb802b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,15 +5,9 @@ Tracing currently targets only gRPC calls.
## Sending traces from containerd daemon ## Sending traces from containerd daemon
By configuring `io.containerd.tracing.processor.v1.otlp` plugin. containerd daemon can send traces to collection endpoints by configuring
containerd daemon can send traces to the specified OpenTelemetry endpoint. [OpenTelemetry exporter environment variables](https://opentelemetry.io/docs/specs/otel/protocol/exporter/)
within the daemon's process space.
```toml
version = 2
[plugins."io.containerd.tracing.processor.v1.otlp"]
endpoint = "http://localhost:4318"
```
The following options are supported. The following options are supported.
@ -24,15 +18,28 @@ The following options are supported.
"http/protobuf" always uses the schema provided by the endpoint and "http/protobuf" always uses the schema provided by the endpoint and
the value of this setting being ignored. the value of this setting being ignored.
The sampling ratio and the service name on the traces could be configured by The sampling ratio and the service name on the traces can be configured by setting
`io.containerd.internal.v1.tracing` plugin. [OpenTelemetry environment variables](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/).
```toml For example, if running containerd as a systemd service, add the environment variables to the service:
version = 2
[plugins."io.containerd.internal.v1.tracing"] ```text
sampling_ratio = 1.0 [Service]
service_name = "containerd" Environment="OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318"
Environment="OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf"
Environment="OTEL_SERVICE_NAME=containerd"
Environment="OTEL_TRACES_SAMPLER=traceidratio"
Environment="OTEL_TRACES_SAMPLER_ARG=1.0"
```
Or if running containerd from the command-line, set the environment variables before starting the daemon:
```bash
export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_SERVICE_NAME="containerd"
export OTEL_TRACES_SAMPLER="traceidratio"
export OTEL_TRACES_SAMPLER_ARG=1.0
``` ```
## Sending traces from containerd client ## Sending traces from containerd client