pub struct Span {
pub context: SpanContext,
pub name: String,
pub kind: SpanKind,
pub start_ms: u64,
pub end_ms: Option<u64>,
pub status: SpanStatus,
pub attributes: HashMap<String, Value>,
pub events: Vec<SpanEvent>,
pub links: Vec<SpanContext>,
}Expand description
A single unit of work within a trace, with timing, status, and metadata.
Fields§
§context: SpanContextIdentifier and parent link for this span.
name: StringHuman-readable name of the operation.
kind: SpanKindClassification of the span.
start_ms: u64Wall-clock start time in milliseconds.
end_ms: Option<u64>Wall-clock end time in milliseconds, once the span is closed.
status: SpanStatusOutcome of the span.
attributes: HashMap<String, Value>Arbitrary key/value metadata attached to the span.
events: Vec<SpanEvent>Timestamped events recorded during the span.
links: Vec<SpanContext>Links to related span contexts (e.g. cross-trace references).
Implementations§
Source§impl Span
impl Span
Sourcepub fn duration_ms(&self) -> Option<u64>
pub fn duration_ms(&self) -> Option<u64>
Duration in milliseconds.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
True if the span has an end time.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Span
impl<'de> Deserialize<'de> for Span
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Span
impl RefUnwindSafe for Span
impl Send for Span
impl Sync for Span
impl Unpin for Span
impl UnsafeUnpin for Span
impl UnwindSafe for Span
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more