[−][src]Trait tracing_timing::SpanGroup
Translate attributes from a tracing span into a timing span group.
All spans whose attributes produce the same Id
-typed value when passed through group
share a namespace for the groups produced by EventGroup::group
on their contained events.
This trait is implemented for all functions with the appropriate signature. Note that you may
run into weird lifetime errors from the compiler when using a closure as a SpanGroup
. This is
a known compiler issue. You can work around it by adding a slight type hint to the arguments
passed to the closure as follows (note the : &_
):
use tracing_timing::{Builder, Histogram}; use tracing::span; let s = Builder::default() .spans(|_: &span::Attributes| "all spans as one") .build(|| Histogram::new(3).unwrap());
Associated Types
type Id
The type of the timing span group.
Required methods
fn group(&self, span: &Attributes) -> Self::Id
Extract the group for this span's attributes.
Implementors
impl SpanGroup for ByField
[src]
impl SpanGroup for ByName
[src]
impl SpanGroup for ByTarget
[src]
impl<F, R> SpanGroup for F where
F: Fn(&Attributes) -> R,
[src]
F: Fn(&Attributes) -> R,