Struct zipkin::OpenSpan
[−]
[src]
pub struct OpenSpan { /* fields omitted */ }
An open span.
This is a guard object - the span will be finished and reported when it falls out of scope.
An open span is either a "local", "client", or "server" span. Local spans are for operations that are local and do not talk to remote services. Client spans are for operations that involve making a request to a remote service. Server spans are for the other end of that - a server which receives a requests from a remote client.
This controls how the span is reported - local spans have an "lc" binary annotation identifying the local endpoint, client spans have "cs" and "cr" annotations indicating the times at which the request was sent and the response was received, and server spans have "sr" and "ss" annotations indicating the times at which the request was received and the response was sent.
A span defaults to being local - use the client()
and server()
methods
to change that for an individual span.
Methods
impl OpenSpan
[src]
fn context(&self) -> TraceContext
[src]
Returns the context associated with this span.
fn server(&mut self)
[src]
Sets this span to be a server span.
When completed, server spans have "sr" and "ss" annotations automatically attached.
fn client(&mut self)
[src]
Sets this span to be a client span.
When completed, client spans have "cs" and "cr" annotations automatically attached.
fn annotate(&mut self, value: &str)
[src]
Attaches an annotation to this span.
fn tag(&mut self, key: &str, value: &str)
[src]
Attaches a binary annotation to this span.
fn detach(&mut self)
[src]
"Detaches" this span from the Tracer
.
The parent of this span is normally re-registered as the Tracer
's
current span when the OpenSpan
drops. This method will cause that to
happen immediately. New child spans created from the Tracer
afterwards
will be parented to this span's parent rather than this span itself.
This is intended to be used to enable the creation of multiple "parallel" spans.