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

otel-kit

otel-kit is the repository for four Rust crates that cover different observability boundaries:

  • otel-init initializes OpenTelemetry providers and tracing subscribers;
  • otel-http provides shared inbound HTTP server spans and context propagation;
  • otel-logger provides application logging and bootstrap for one process;
  • axum-otel adapts the shared HTTP span behavior to Axum and tower-http::TraceLayer.

Choose the smallest crate that owns the behavior your application needs. An Axum application can use axum-otel with its own subscriber, while an application that wants the repository’s complete logging setup can combine it with otel-logger, adding env for environment configuration. Provider-only users can depend directly on otel-init.

The workspace version is 0.34.0; the package split is for the upcoming release. Cargo.toml declares Rust 1.96.0 as the minimum supported Rust version. The repository toolchain may pin a newer compiler for local development.

Where to start

  • Getting started — install the right crates and build a minimal application.
  • Crates — choose the smallest crate for each observability responsibility.
  • Cargo features — keep optional dependencies and capabilities explicit.
  • Comparison with axum-tracing-opentelemetry — choose between focused request middleware and this workspace’s broader observability setup.
  • OTLP export and lifecycle — configure exporters and shut providers down safely.
  • HTTP span attributes — understand emitted fields before writing dashboards or alerts.

The complete type-level references are on docs.rs for otel-http, docs.rs for otel-logger, docs.rs for otel-init, and docs.rs for axum-otel.

The new crate references become available when the split packages are published.