pub struct ActionSpan {
pub ref_count: usize,
pub trace_id: [u8; 16],
pub span_id: [u8; 8],
pub trace_state: String,
pub parent_span_id: Option<[u8; 8]>,
pub metadata: Option<&'static Metadata<'static>>,
pub kind: TraceKind,
pub start: SystemTime,
pub end: SystemTime,
pub attributes: HashMap<&'static str, AttributeValue>,
pub events: Vec<ActionEvent>,
pub status: SpanStatus,
}
Fields§
§ref_count: usize
§trace_id: [u8; 16]
A unique identifier for a trace. All spans from the same trace share
the same trace_id
. The ID is a 16-byte array. An ID with all zeroes is considered invalid.
span_id: [u8; 8]
A unique identifier for a span within a trace, assigned when the span is created. The ID is an 8-byte array. An ID with all zeroes is considered invalid.
trace_state: String
trace_state conveys information about request position in multiple distributed tracing graphs. It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header See also https://github.com/w3c/distributed-tracing for more details about this field.
parent_span_id: Option<[u8; 8]>
The span_id
of this span’s parent span. If this is a root span, then this
field must be empty.
metadata: Option<&'static Metadata<'static>>
A description of the span, with its name inside.
kind: TraceKind
Distinguishes between spans generated in a particular context. For example,
two spans with the same name may be distinguished using CLIENT
(caller)
and SERVER
(callee) to identify queueing latency associated with the span.
start: SystemTime
start_time_unix_nano is the start time of the span. On the client side, this is the time kept by the local machine where the span execution starts. On the server side, this is the time when the server’s application handler starts running. Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
This field is semantically required and it is expected that end_time >= start_time.
end: SystemTime
end_time_unix_nano is the end time of the span. On the client side, this is the time kept by the local machine where the span execution ends. On the server side, this is the time when the server application handler stops running. Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
This field is semantically required and it is expected that end_time >= start_time.
attributes: HashMap<&'static str, AttributeValue>
attributes is a collection of key/value pairs.
The OpenTelemetry API specification further restricts the allowed value types: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/common/README.md#attribute Attribute keys MUST be unique (it is not allowed to have more than one attribute with the same key).
events: Vec<ActionEvent>
events is a collection of Event items.
status: SpanStatus
Implementations§
Source§impl ActionSpan
impl ActionSpan
pub fn start_root(&mut self, attributes: &Attributes<'_>)
pub fn start_child( &mut self, attributes: &Attributes<'_>, trace_id: &[u8; 16], parent_span_id: &[u8; 8], )
pub fn end(&mut self)
Trait Implementations§
Source§impl Clone for ActionSpan
impl Clone for ActionSpan
Source§fn clone(&self) -> ActionSpan
fn clone(&self) -> ActionSpan
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ActionSpan
impl Debug for ActionSpan
Source§impl Default for ActionSpan
impl Default for ActionSpan
Source§impl Visit for ActionSpan
impl Visit for ActionSpan
Source§fn record_debug(&mut self, field: &Field, value: &dyn Debug)
fn record_debug(&mut self, field: &Field, value: &dyn Debug)
fmt::Debug
.Source§fn record_f64(&mut self, field: &Field, value: f64)
fn record_f64(&mut self, field: &Field, value: f64)
Source§fn record_i64(&mut self, field: &Field, value: i64)
fn record_i64(&mut self, field: &Field, value: i64)
Source§fn record_u64(&mut self, field: &Field, value: u64)
fn record_u64(&mut self, field: &Field, value: u64)
Source§fn record_i128(&mut self, field: &Field, value: i128)
fn record_i128(&mut self, field: &Field, value: i128)
Source§fn record_u128(&mut self, field: &Field, value: u128)
fn record_u128(&mut self, field: &Field, value: u128)
Source§fn record_bool(&mut self, field: &Field, value: bool)
fn record_bool(&mut self, field: &Field, value: bool)
Source§fn record_str(&mut self, field: &Field, value: &str)
fn record_str(&mut self, field: &Field, value: &str)
Source§fn record_error(&mut self, field: &Field, value: &(dyn Error + 'static))
fn record_error(&mut self, field: &Field, value: &(dyn Error + 'static))
Error
. Read more