tracing-opentelemetry
OpenTelemetry integration layer for the tracing ecosystem in Rust
Repository Health
Technical Analysis
tracing-opentelemetry bridges Rust’s tracing instrumentation framework with the OpenTelemetry ecosystem. It provides a tracing-subscriber Layer that converts tracing spans and events into OpenTelemetry spans, metrics, and context, so applications instrumented with tracing can export distributed traces to any OpenTelemetry-compatible backend (Jaeger, Zipkin, OTLP collectors).
Maintained under the tokio-rs organization alongside the core tracing crate, it’s the de facto standard way to get OpenTelemetry-compatible distributed tracing out of a tracing-instrumented Rust service without rewriting instrumentation calls.
What You Get
OpenTelemetryLayer- a tracing-subscriber Layer that converts tracing spans into OpenTelemetry spans automaticallyOpenTelemetrySpanExt- inject/extract trace context across service boundaries, and set attributes/status/events on the current span- Optional
MetricsLayer(via themetricsfeature) for exporting OpenTelemetry metrics from specifically-named tracing events - Interop with any OpenTelemetry exporter (OTLP, Jaeger, Zipkin) since it only produces standard OpenTelemetry spans
Common Use Cases
- Adding distributed tracing to an existing
tracing-instrumented Rust web service (Axum, Actix, Tonic) with minimal code changes - Exporting traces to Jaeger or an OTLP collector for latency debugging across microservices
- Propagating trace context across async task boundaries and network calls via
OpenTelemetrySpanExt - Emitting OpenTelemetry metrics from tracing events using the optional
metricsfeature
Under The Hood
Architecture - The crate is a tracing_subscriber::Layer implementation (layer.rs, part of a 4,300-line src/ tree) that hooks into tracing’s span lifecycle callbacks (on_new_span, on_enter, on_close, on_event) and mirrors them into OpenTelemetry Span objects held in an internal registry extension (stack.rs, otel_context.rs); span_ext.rs implements OpenTelemetrySpanExt for cross-boundary context propagation, and metrics.rs provides the optional MetricsLayer. Tech Stack - Built directly on opentelemetry 0.32, tracing/tracing-core/tracing-subscriber 0.3, with optional tracing-log and smallvec dependencies; dev-dependencies include criterion for benchmarking and opentelemetry_sdk’s testing feature for span assertion in tests. Notably the crate’s own version numbers are intentionally decoupled from the opentelemetry crate’s versioning (documented in the README, referencing issue #170), which is an important compatibility gotcha for consumers pinning versions. Code Quality - A dedicated tests/ directory covers parent/child span relationships (parents.rs, follows_from.rs), context propagation (trace_state_propagation.rs), parallel/async spans (parallel.rs), and error handling (errors.rs); five runnable examples/ (including OTLP export and remote-context propagation) double as both documentation and integration smoke tests. API Design - The API surface is intentionally small: one Layer to install (OpenTelemetryLayer::new(tracer)), one extension trait for manual control, and feature flags to opt into metrics. This keeps day-one setup low-boilerplate, though users must independently understand tracing_subscriber’s Layer/Registry model and OpenTelemetry’s SDK setup to wire it together correctly.
Used by 9 apps in this directory
Cap
Team Chat · Video Conferencing
Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.
CubeSandbox
Developer Tools · Security · AI Agents
Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.
Fluree DB
Databases
A temporal, verifiable graph database with git-like branching, integrated vector/text/geo search, and RDF/SPARQL/JSON-LD/openCypher support — benchmarked at 10.4x faster than the next database on the full Wikidata dump.
Huly Platform
Project Management · Team Chat · Collaboration
Open-source all-in-one workspace that replaces Linear, Jira, Slack, and Notion for product and engineering teams.
iii
Developer Tools · Devops
Compose, extend, and observe every backend service in real time using three primitives: Workers, Functions, and Triggers.
Laminar
AI Development · Monitoring
Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.
Mistle
AI Agents · Developer Tools
Self-hostable platform for running autonomous coding agents in isolated, credentialless sandboxes with brokered credentials, reusable snapshots, and event-driven triggers.
Svix
Developer Tools · Automation
Open source, self-hostable webhook infrastructure that handles delivery, retries, HMAC signing, and multi-tenant event management so you never have to build a webhooks system from scratch.
Vibe Kanban
AI Agents · AI Code Assistants · Project Management
A kanban board for planning work and dispatching Claude Code, Codex, Gemini CLI, and eight other coding agents into isolated git worktrees, then reviewing and merging their diffs from one UI.