Struct opentracingrust::Tracer
[−]
[src]
pub struct Tracer { /* fields omitted */ }
The library users interface to tracing.
This structure is the focus point for clients to use in combination with SpanContext
.
The configured tracer is stored in this structure and backs the available methods.
The Tracer
structure also provides some utility methods to make common operations easier.
Methods
impl Tracer
[src]
fn new<T: TracerInterface + 'static>(tracer: T) -> Tracer
[src]
Creates a new Tracer
for a concrete tracer.
impl Tracer
[src]
fn extract(&self, fmt: ExtractFormat) -> Result<Option<SpanContext>>
[src]
Attempt to extract a SpanContext from a carrier.
If the carrier (i.e, HTTP Request, RPC Message, ...) includes tracing information
this method returns Ok(Some(context))
, otherwise Ok(None)
is returned.
If the method fails to extract a context because the carrier fails or because
the tracing information is incorrectly formatted an Error
is returned.
fn inject(&self, context: &SpanContext, fmt: InjectFormat) -> Result<()>
[src]
Inject tracing information into a carrier.
If the method fails to inject the context because the carrier fails.
fn span(&self, name: &str) -> Span
[src]
Create a new Span
with the given operation name and default starting options.
fn span_with_options(&self, name: &str, options: StartOptions) -> Span
[src]
Create a new Span
with the given operation name and starting options.