logo
pub struct Span { /* private fields */ }
Available on crate feature trace only.
Expand description

Single operation within a trace.

Implementations

Convert information in this span into exporter::trace::SpanData. This function copies all data from the current span, which will create a overhead.

Trait Implementations

Formats the value using the given formatter. Read more

Report span on inner drop

Records events at a specific time in the context of a given Span.

Note that the OpenTelemetry project documents certain “standard event names and keys” which have prescribed semantic meanings.

Returns the SpanContext for the given Span.

Returns true if this Span is recording information like events with the add_event operation, attributes using set_attributes, status with set_status, etc. Always returns false after span end.

Sets a single Attribute where the attribute properties are passed as arguments.

Note that the OpenTelemetry project documents certain “standard attributes” that have prescribed semantic meanings.

Sets the status of this Span.

If used, this will override the default span status, which is Status::Unset.

Updates the Span’s name.

Finishes the span with given timestamp.

Record an event in the context this span. Read more

Record an error as an event for this span. Read more

Set multiple attributes of this span. Read more

Signals that the operation described by this span has now ended.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Attaches the provided Context to this type, returning a WithContext wrapper. Read more

Attaches the current Context to this type, returning a WithContext wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.