mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 20:46:15 -04:00
1.7 KiB
1.7 KiB
title |
---|
tracing (Caddyfile directive) |
tracing
It provides integration with OpenTelemetry tracing facilities.
When enabled, it will propagate an existing trace context or initialize a new one.
It is based on github.com/open-telemetry/opentelemetry-go.
It uses gRPC as an exporter protocol and W3C tracecontext and baggage as propagators.
Syntax
tracing {
[span <span_name>]
}
-
<span_name> is a span name. Please see span naming guidelines.
Placeholders may be used in span names; keep in mind that tracing happens as early as possible, so only request placeholders may be used, and not response placeholders.
Configuration
Environment variables
It can be configured using the environment variables defined by the OpenTelemetry Environment Variable Specification.
For the exporter configuration details, please see spec.
For example:
export OTEL_EXPORTER_OTLP_HEADERS="myAuthHeader=myToken,anotherHeader=value"
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://my-otlp-endpoint:55680
Examples
Here is a Caddyfile example:
handle /example* {
tracing {
span example
}
reverse_proxy 127.0.0.1:8081
}