I tried using the tracing directive, and it does what I need, namely adding a traceId to the log and a traceparent header. But it also starts an OTEL exporter, which I do not need. Is there a way to just have the trace ids and traceparent header without the OTEL export stuff going on?
But if all you need is a UUID, don’t use tracing. Instead, use the {uuid} placeholder. You can add it to a request_header to send it upstream. As of v2.8.0, this’ll also be included in the logs (you can build from master if you need that right away).
For example setting OTEL_TRACES_EXPORTER=none does not work, it still attempts to export and produces the errors.
To be able to get a traceid into the log and a traceparent header I probably need a caddy module? The format is also not an uuid, a trace id is 32 digits hex and the parent (span) is 16 digits hex.
I tried OTEL_SDK_DISABLED as well, does not make a difference.
I need the trace id and traceparent in the proper format. I do not need the OTEL exporter because caddy‘s stderr (where all my logging is going, inclusive access logging), is already having all the information I need. All output of my docker containers ends up in Google cloud stack driver logging. The only missing piece is now proper trace ids to let stackdriver correlate the logs of the various containers. All the containers (except caddy currently) conform to the traceid and traceparent convention.
OTEL is only one software ecosystem that uses the same traceid and traceparent convention, there are many others.