Skip to main content

instrument_named_dyn

Macro instrument_named_dyn 

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

Instruments a future with a named span whose name is built at runtime. The future owns the name: pass a String or Arc<str> to keep the future 'static. Usage: instrument_named_dyn!(future, format!("op {id}"))

ยงExamples

use micromegas_tracing::prelude::*;

let future = async { 42 };
let result = instrument_named_dyn!(future, format!("operation {}", 1)).await;