Skip to main content

init_task_span_stack

Function init_task_span_stack 

Source
pub async fn init_task_span_stack()
Expand description

Initialize the task-local span stack for the current async task.

Call this at the top of your async function to enable task-local span tracking. If not initialized, the tracer falls back to thread-local storage.

§Example

tokio::spawn(async {
    init_task_span_stack().await;
    // ... use tracer
});