Skip to content

feat(tracing): add COMPOSE_OTEL_DEBUG to surface OTel internals - #14152

Open
htoyoda18 wants to merge 1 commit into
docker:mainfrom
htoyoda18:feat/otel-debug-env-var
Open

feat(tracing): add COMPOSE_OTEL_DEBUG to surface OTel internals#14152
htoyoda18 wants to merge 1 commit into
docker:mainfrom
htoyoda18:feat/otel-debug-env-var

Conversation

@htoyoda18

@htoyoda18 htoyoda18 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

What I did

OTel SDK/exporter internal errors (otel.ErrorHandler) and the tracer shutdown/flush error in wrapRunE were both always discarded, making it impossible to diagnose tracing issues (e.g. a misconfigured or unreachable OTLP endpoint) without instrumenting the code.

Added tracing.DebugEnabled(), gated on a new COMPOSE_OTEL_DEBUG environment variable, and used it in both places:

  • internal/tracing's otel.ErrorHandler now prints to stderr when enabled instead of always being a no-op
  • the previously-discarded tracingShutdown(ctx) error in cmd/cmdtrace/cmd_span.go is now printed to the command's stderr (dockerCli.Err()) when enabled

Default behavior (COMPOSE_OTEL_DEBUG unset) is unchanged — tracing plumbing still never leaks into ordinary CLI output.

Related issue
N/A

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

Signed-off-by: hiroto.toyoda <hiroto.toyoda@dena.com>
@htoyoda18
htoyoda18 requested review from a team as code owners August 28, 2026 19:23
@htoyoda18
htoyoda18 requested review from glours and ndeloof August 28, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant