Context
Cross-language parity gap surfaced while comparing docker-wrapper with the Elixir docker_wrapper_ex. The Elixir side has first-class telemetry integration (events around run/build/compose/stream lifecycle); the Rust side currently emits nothing.
Proposal
Add tracing spans to DockerCommand::execute and execute_stream, plus the compose/buildx/swarm feature-gated paths:
- Top-level span per command invocation with fields:
command (e.g. run, ps, compose up), args_count, platform (docker/podman/nerdctl when detected).
tracing::info! on start, tracing::info! on successful exit with duration + exit_code.
tracing::warn! / error! on non-zero exit with stderr snippet (bounded length).
- Stream variant:
tracing::debug! per line under a parent span so callers can filter verbose paths at the subscriber level.
Gate behind an optional tracing feature (default on) so no-instrumentation builds stay lean.
Parity reference
docker_wrapper_ex emits [:docker_wrapper, :exec, :start|:stop|:exception] events with equivalent metadata. Matching fields on the Rust side makes it easy to correlate logs when both wrappers run in the same system (e.g. multi-language test harnesses).
Out of scope
- OpenTelemetry exporter wiring (leave to the consuming binary).
- Metrics -- add later via a
metrics crate bridge if demand surfaces.
Context
Cross-language parity gap surfaced while comparing
docker-wrapperwith the Elixirdocker_wrapper_ex. The Elixir side has first-class telemetry integration (events around run/build/compose/stream lifecycle); the Rust side currently emits nothing.Proposal
Add
tracingspans toDockerCommand::executeandexecute_stream, plus the compose/buildx/swarm feature-gated paths:command(e.g.run,ps,compose up),args_count,platform(docker/podman/nerdctl when detected).tracing::info!on start,tracing::info!on successful exit withduration+exit_code.tracing::warn!/error!on non-zero exit with stderr snippet (bounded length).tracing::debug!per line under a parent span so callers can filter verbose paths at the subscriber level.Gate behind an optional
tracingfeature (default on) so no-instrumentation builds stay lean.Parity reference
docker_wrapper_exemits[:docker_wrapper, :exec, :start|:stop|:exception]events with equivalent metadata. Matching fields on the Rust side makes it easy to correlate logs when both wrappers run in the same system (e.g. multi-language test harnesses).Out of scope
metricscrate bridge if demand surfaces.