pub struct Span {
pub span_id: u64,
pub trace_id: u64,
pub parent_id: u64,
pub service: String,
pub resource: String,
pub name: String,
pub start: i64,
pub duration: i64,
pub error: i32,
pub meta: HashMap<String, String>,
pub metrics: HashMap<String, f64>,
pub span_type: Option<String>,
}Expand description
A single span in a distributed trace
Fields§
§span_id: u64Span ID (unique identifier for this span)
trace_id: u64Trace ID (shared across all spans in the trace)
parent_id: u64Parent span ID (0 if root span)
service: StringService name
resource: StringResource name (e.g., endpoint, SQL query)
name: StringOperation name (e.g., “web.request”, “db.query”)
start: i64Start timestamp (nanoseconds since epoch)
duration: i64Duration in nanoseconds
error: i32Error flag (0 = no error, 1 = error)
meta: HashMap<String, String>Key-value metadata
metrics: HashMap<String, f64>Numeric metadata
span_type: Option<String>Span type (web, db, cache, etc.)
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 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