minitrace-rust
minitrace-rust copied to clipboard
Doc: block expression requirement
The documentation is entirely silent on the fact that block expressions are an absolute requirement for setting up spans in addition to the #[trace] attribute.
The records of LocalSpan are submitted to the collector once the guard of set_local_parent gets dropped. So, if you collect the trace when the guard is alive, the LocalSpan will have no chance to get collected. And yes, we need to update the document for this behavior.
Because of #153, this becomes not true. As long as the root span drops after all of its children, block expressions are not needed.