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

Doc: block expression requirement

Open taqtiqa-mark opened this issue 4 years ago • 1 comments

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.

taqtiqa-mark avatar Mar 22 '22 08:03 taqtiqa-mark

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.

andylokandy avatar Mar 23 '22 15:03 andylokandy

Because of #153, this becomes not true. As long as the root span drops after all of its children, block expressions are not needed.

andylokandy avatar Jul 18 '23 14:07 andylokandy