Struct zipkin::span::Span
[−]
[src]
pub struct Span { /* fields omitted */ }
A Span
represents a single operation over some range of time.
Multiple spans make up a single "trace" of a distributed computation, and spans can be nested. A new trace is created with a "root" span, and subsections of that computation are recorded in individual spans.
For spans tracing a remote service call, two records will typically be generated, one from the client and the other from the server. The client is responsible for recording the timestamp and duration associated with the span, and the server span should omit that information. The client and server may both add their own annotations and binary annotations the span - they will be merged.
Methods
impl Span
[src]
pub fn builder() -> Builder
[src]
Returns a builder used to construct a Span
.
pub fn trace_id(&self) -> TraceId
[src]
The randomly generated, unique identifier for a trace, set on all spans within it.
pub fn name(&self) -> Option<&str>
[src]
The logical operation this span represents (e.g. an RPC method).
Leave absent if unknown.
These are lookup labels, so take care to ensure names are low cardinality. For example, do not embed variables into the name.
pub fn parent_id(&self) -> Option<SpanId>
[src]
The parent span ID, or None
if this is the root span in a trace.
pub fn id(&self) -> SpanId
[src]
The unique 64 bit identifier for this operation within the trace.
pub fn kind(&self) -> Option<Kind>
[src]
The "kind" of operation this span represents.
When absent, the span is absent or incomplete.
pub fn timestamp(&self) -> Option<SystemTime>
[src]
The start of the span.
pub fn duration(&self) -> Option<Duration>
[src]
The duration of the critical path, if known.
Durations are recorded in microseconds, and rounded up to a minimum of 1. Durations of children can be longer than their parents due to asynchronous operations.
pub fn debug(&self) -> bool
[src]
Determines if this span is part of a normal or forcibly sampled span.
If true, the span should always be sampled regardless of the sampling configuration.
[src]
Determines if this span was started by another tracer (e.g. on a different host).
pub fn local_endpoint(&self) -> Option<&Endpoint>
[src]
Returns the host that recorded this span, primarily for query by service name.
Instrumentation should always record this. The IP address is usually the site local or advertised service address. When present, the port indicates the listen port.
pub fn remote_endpoint(&self) -> Option<&Endpoint>
[src]
Returns the other side of the connection for RPC or messaging spans.
pub fn annotations(&self) -> &[Annotation]
[src]
Returns the annotations associated with this span.
[src]
Returns tags used to give spans context for search, viewing, and analysis.
Trait Implementations
impl Debug for Span
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more