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.