Crates
otel-kit is the repository for four crates, not an all-inclusive package.
| Crate | Responsibility | Use it when |
|---|---|---|
otel-init | Resources, OTLP providers, subscriber setup, and provider shutdown | You own the subscriber or need provider-level initialization |
otel-http | Shared inbound HTTP server spans, fields, context propagation, and dynamic macros | You need framework-independent HTTP helpers |
otel-logger | Application logging and bootstrap for one process | You want the opinionated Logger facade |
axum-otel | Axum-specific TraceLayer callbacks | You need inbound Axum request spans |
The dependency direction is:
axum-otel -> otel-http
applications -> otel-logger -> otel-init
otel-http depends on neither otel-init nor otel-logger. Logger depends on
otel-init with subscriber, and does not depend on otel-http. Applications
can combine the crates or supply their own subscriber.
Public entry points
otel-init
get_resourceinit_tracer_provider,init_meter_provider,init_logger_providerOtelGuardBoxLayer,init_env_filter,init_tracing_subscriberwithsubscriber- Existing
opentelemetry,opentelemetry_sdk,tracing_opentelemetryre-exports
otel-http
fields,propagation,context,spanmodules at the crate root- Root
dyn_span!anddyn_event!macros, with themacrosfeature - No nested
httpmodule orextractaliases
otel-logger
Logger,LoggerGuard,LoggerFileAppender,LogFormat,LogRollingRotationFmtSpan,defaultinit_logging,init_tracing_from_logger,setup_tracing,init_layer- Explicit
OtelGuard,BoxLayer,init_env_filterre-exports fromotel-init Logger::from_env,init_logger_from_env,init_logging_from_envwithenv
These entries are at the crate root. There is no nested logger or otel
module and no blanket forwarding of otel-init or SDK crates.
axum-otel
AxumOtelSpanCreatorAxumOtelOnResponseAxumOtelOnFailureLevelre-export fromtracing
See features for dependency choices and migration for the upcoming package split.