opentelemetry-rust icon indicating copy to clipboard operation
opentelemetry-rust copied to clipboard

Possible to use async without with_context everywhere?

Open rex-remind101 opened this issue 2 years ago • 1 comments

I'm wondering if it's possible to have a series of awaits in the function a span is created without every single async call requiring .with_context(ctx) appended?

Example here https://github.com/open-telemetry/opentelemetry-rust/blob/482772f2317e242e6b98bfe04ed42e4dac8cf77b/examples/async/src/main.rs#L52

rex-remind101 avatar Feb 05 '22 20:02 rex-remind101

Could consider creating a crate with macros to help here, similar to how tracing-attributes allows you to have a more ergonomic async API.

jtescher avatar Mar 20 '22 00:03 jtescher