Skip to main content

Module context

Module context 

Source
Available on crate feature otel only.
Expand description

OpenTelemetry context propagation helpers for async boundaries.

The SDK uses tokio::spawn in run(). Those spawned futures are wrapped with FutureExt::with_context() so the caller’s OTel context is re-attached on every poll, surviving task migration across tokio worker threads. run_turn() executes directly in the caller task and therefore does not need an extra spawn propagation hop.

Functions§

capture_context
Capture the current OTel context for propagation into a spawned task.
current_with_span_context
Capture the current OTel context and replace the active span.