Skip to content

feat: add comprehensive tracing instrumentation#197

Merged
joshrotenberg merged 2 commits intomainfrom
feat/tracing-instrumentation
Jan 4, 2026
Merged

feat: add comprehensive tracing instrumentation#197
joshrotenberg merged 2 commits intomainfrom
feat/tracing-instrumentation

Conversation

@joshrotenberg
Copy link
Copy Markdown
Owner

Adds tracing integration throughout the library for observability.

Changes

  • Instrument CommandExecutor::execute_command() with command name, runtime, timeout, exit status, and stdout/stderr output
  • Instrument Template lifecycle methods (start, stop, remove, is_running, wait_for_ready) with container state tracking
  • Instrument retry logic in DebugExecutor with attempt counts, delays, and backoff calculations
  • Add tracing documentation to lib.rs with usage examples showing how to enable and configure tracing
  • Update version numbers in feature flag examples to 0.9

Usage

Users can enable tracing by adding a subscriber:

use tracing_subscriber::EnvFilter;

tracing_subscriber::fmt()
    .with_env_filter(EnvFilter::from_default_env())
    .init();

Then control verbosity with RUST_LOG:

# Show all docker-wrapper traces
RUST_LOG=docker_wrapper=trace cargo run

# Show only command execution info
RUST_LOG=docker_wrapper::command=debug cargo run

# Show template lifecycle events
RUST_LOG=docker_wrapper::template=debug cargo run

Closes #196

Adds tracing integration throughout the library for observability:

- Instrument CommandExecutor::execute_command() with command name,
  runtime, timeout, exit status, and stdout/stderr output
- Instrument Template lifecycle methods (start, stop, remove,
  is_running, wait_for_ready) with container state tracking
- Instrument retry logic in DebugExecutor with attempt counts,
  delays, and backoff calculations
- Add tracing documentation to lib.rs with usage examples
- Update version numbers in feature flag examples to 0.9

Closes #196
The tracing-subscriber example requires the env-filter feature which
is not a dependency of this crate. Mark the doctest as ignore since
it demonstrates user code, not library code.
@joshrotenberg joshrotenberg merged commit 4e2437c into main Jan 4, 2026
11 checks passed
@joshrotenberg joshrotenberg deleted the feat/tracing-instrumentation branch January 4, 2026 23:01
@github-actions github-actions Bot mentioned this pull request Jan 4, 2026
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.

feat: add comprehensive tracing instrumentation throughout the library

1 participant