From 904bc738020de25d440fa723b1901f566f1ffca0 Mon Sep 17 00:00:00 2001 From: dpk-jr Date: Sun, 31 May 2026 19:46:20 +0800 Subject: [PATCH] docs: add OTLP exporter documentation to OpenTelemetry section Add configuration examples for OTLP trace export including: - OTEL_TRACES_EXPORTER=otlp environment variable - gRPC protocol (default, port 4317) - HTTP/protobuf protocol (port 4318) - Links to compatible backends (Jaeger, Grafana Tempo, Datadog, AWS X-Ray) - Reference to OpenTelemetry environment variable specification Closes #4001 --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index 6ccba2a1c350..310944f31bcb 100644 --- a/README.md +++ b/README.md @@ -814,6 +814,37 @@ export JAEGER_TRACE=0.0.0.0:6831 > set the environment variable `setx -m JAEGER_TRACE "0.0.0.0:6831"`, > restart `buildkitd` in a new terminal and the traces will be collected automatically. +### OTLP Exporter + +BuildKit also supports exporting traces via the [OpenTelemetry Protocol (OTLP)](https://opentelemetry.io/docs/specs/otlp/). +To use OTLP instead of Jaeger, set `OTEL_TRACES_EXPORTER` to `otlp` and configure the OTLP endpoint: + +#### Using gRPC protocol (default) + +```bash +export OTEL_TRACES_EXPORTER=otlp +export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 +# restart buildkitd and buildctl +``` + +#### Using HTTP/protobuf protocol + +```bash +export OTEL_TRACES_EXPORTER=otlp +export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf +export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 +# restart buildkitd and buildctl +``` + +The OTLP exporter can send traces to any OTLP-compatible backend such as +[Jaeger](https://www.jaegertracing.io/), +[Grafana Tempo](https://grafana.com/oss/tempo/), +[Datadog](https://www.datadoghq.com/), or +[AWS X-Ray](https://aws.amazon.com/xray/). + +For a full list of supported environment variables, see the +[OpenTelemetry Environment Variable Specification](https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/). + ## Running BuildKit without root privileges Please refer to [`docs/rootless.md`](docs/rootless.md).