[−][src]Struct zipkin::Span
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.
Implementations
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 Debug for Span
[src]
impl<'de> Deserialize<'de> for Span
[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Span, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<Span, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl From<Span> for Builder
[src]
impl Serialize for Span
[src]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Auto Trait Implementations
impl RefUnwindSafe for Span
[src]
impl Send for Span
[src]
impl Sync for Span
[src]
impl Unpin for Span
[src]
impl UnwindSafe for Span
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,