[][src]Struct zipkin::span::Span

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 local 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.

pub fn shared(&self) -> bool[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.

pub fn tags(&self) -> &HashMap<String, String, RandomState>[src]

Returns tags used to give spans context for search, viewing, and analysis.

Trait Implementations

impl Clone for Span[src]

impl From<Span> for Builder[src]

impl Debug for Span[src]

Auto Trait Implementations

impl Send for Span

impl Sync for Span

impl Unpin for Span

impl UnwindSafe for Span

impl RefUnwindSafe for Span

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,