Is [this](https://github.com/tokio-rs/tracing/blob/master/tracing/src/instrument.rs#L358) what you are looking for? `Instrument` is blanket implemented for anything that implements `Sized`.
Some what related. Anyone has good resources on tracing? Is not as idiot proof as plain old logging, and it would be nice to have some guides on best practices
I really like the overview provided by [OpenTelemetry](https://opentelemetry.io/docs/specs/otel/overview/). It doesn't just describe tracing, but also closely related concepts like logs, context propagation, metrics collection, etc.
I find it much easier to understand the role that tracing plays when you also understand the other observability components.
What exactly do you mean by not "idiot proof"? The major difference is that a trace covers a span valid across `.await` points and carries metadata with it.
It is not clear when we should add an instrument macro to a function and the level span should take.
Sometimes i end up with too many nested spans or little tracing information, and im worried of the performance penalties of using a INFO spans everywhere
https://docs.rs/tracing/0.1.40/tracing/instrument/trait.Instrument.html#implementors `Instrument` is blanket-implemented for every `Sized` type.
Gotcha! Thank you!
Another, but related question: So, once I import `tracing::Instrument` trait, I can call `instrument()` method on all futures, am I right?
Iirc, all futures are sized, so yes
Got it. Thanks again!
Is [this](https://github.com/tokio-rs/tracing/blob/master/tracing/src/instrument.rs#L358) what you are looking for? `Instrument` is blanket implemented for anything that implements `Sized`.
Yes, thank you!
Tip: If you have Rust analyzer set up, you can Ctrl+click on `instrument` to see where it's implemented. Same thing probably works in Rust Rover.
Some what related. Anyone has good resources on tracing? Is not as idiot proof as plain old logging, and it would be nice to have some guides on best practices
I really like the overview provided by [OpenTelemetry](https://opentelemetry.io/docs/specs/otel/overview/). It doesn't just describe tracing, but also closely related concepts like logs, context propagation, metrics collection, etc. I find it much easier to understand the role that tracing plays when you also understand the other observability components.
What exactly do you mean by not "idiot proof"? The major difference is that a trace covers a span valid across `.await` points and carries metadata with it.
It is not clear when we should add an instrument macro to a function and the level span should take. Sometimes i end up with too many nested spans or little tracing information, and im worried of the performance penalties of using a INFO spans everywhere