pub struct SpanStart<'a> {
pub name: &'a str,
pub kind: SpanKind,
pub parent: Option<SpanHandle>,
pub attributes: Vec<(String, AttrValue)>,
pub start_time_unix_nanos: Option<u64>,
}Expand description
Arguments for TracerPlugin::start_span. A struct rather than a long
positional parameter list so the trait stays forward-compatible: new
optional fields can be added without breaking existing implementations
that use ..Default::default().
Fields§
§name: &'a strSpan name. Should follow OTel semantic conventions (e.g., for a
server span handling GET /users/:id, use "GET /users/:id").
kind: SpanKindSpan kind. Defaults to SpanKind::Internal.
parent: Option<SpanHandle>Parent span handle, or None for a root span. Non-None parents
belonging to a different tracer are treated as unknown and the new
span is rooted.
attributes: Vec<(String, AttrValue)>Initial attributes set atomically with span creation. Equivalent
to calling TracerPlugin::set_attribute for each pair after
start_span, but gives implementations a chance to include them
in the initial emission without a buffer flush.
start_time_unix_nanos: Option<u64>Start time override, in nanoseconds since the Unix epoch. None
means “use the tracer’s current clock” — this is the common case.
Set this when recording historical or externally-sourced spans.