pub struct Span {
pub trace_id: TraceId,
pub span_id: SpanId,
pub parent_span_id: Option<SpanId>,
pub name: String,
pub kind: SpanKind,
pub start_unix_nano: u64,
pub end_unix_nano: u64,
pub attributes: Attributes,
pub events: Vec<SpanEvent>,
pub status: StatusCode,
pub status_message: String,
pub dropped_events: u32,
}Expand description
A finished (or in-progress) span.
Fields§
§trace_id: TraceId§span_id: SpanId§parent_span_id: Option<SpanId>§name: String§kind: SpanKind§start_unix_nano: u64§end_unix_nano: u64§attributes: Attributes§events: Vec<SpanEvent>§status: StatusCode§status_message: String§dropped_events: u32Events dropped because the per-span limit was reached.
Implementations§
Source§impl Span
impl Span
pub fn new( trace_id: TraceId, parent: Option<SpanId>, name: impl Into<String>, start_unix_nano: u64, ) -> Self
Sourcepub fn attr(&self, key: &str) -> Option<&AttrValue>
pub fn attr(&self, key: &str) -> Option<&AttrValue>
Attribute lookup (used by tests and tooling).
Sourcepub fn add_event(
&mut self,
name: &str,
time_unix_nano: u64,
attributes: Attributes,
)
pub fn add_event( &mut self, name: &str, time_unix_nano: u64, attributes: Attributes, )
Record an event, respecting MAX_EVENTS_PER_SPAN.
Trait Implementations§
impl StructuralPartialEq for Span
Auto Trait Implementations§
impl Forget for Span
impl Freeze for Span
impl Move 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