span_async_named

Macro span_async_named 

Source
macro_rules! span_async_named {
    ($name:expr, $async_block:expr) => { ... };
}
Expand description

Instruments an async block with a named span using a static string. This creates both the SpanLocation and instruments the future in one macro call.

ยงExamples

use micromegas_tracing::prelude::*;

let result = span_async_named!("database_query", async {
    // async work here
    42
}).await;