Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cargo features

tracing-otel has no default features. Every application must select the modules its source code uses.

FeatureAddsImplies
fieldsHTTP request field extractionhttp dependency only
macrosRuntime-level dyn_span! and dyn_event!tracing dependency
httpHTTP context extraction and injectionfields
contextCurrent trace/span IDs and remote-parent attachmenthttp
spanShared HTTP server span creationcontext, macros
otelRe-exports from otel-initotel-init dependency
loggerOpinionated subscriber, console/file logging, traces, metrics, and optional OTLP logsotel, otel-init/subscriber
envEnvironment deserialization for Loggerlogger

Examples:

# Shared request-span utilities without the Logger facade.
tracing-otel = { version = "0.33.1", features = ["span"] }

# Complete code-configured application bootstrap.
tracing-otel = { version = "0.33.1", features = ["logger"] }

# Logger plus environment configuration.
tracing-otel = { version = "0.33.1", features = ["env"] }

axum-otel enables the tracing-otel capabilities it uses internally. A consumer does not need to duplicate those internal feature choices unless it also imports tracing-otel APIs directly.

otel-init has one optional feature:

FeatureAdds
subscribertracing-subscriber integration and the OpenTelemetry log bridge

Useful contributor checks:

cargo check -p tracing-otel --no-default-features
cargo check -p tracing-otel --no-default-features --features span
cargo check -p tracing-otel --no-default-features --features logger
cargo check -p tracing-otel --no-default-features --features env