pub struct TraceService { /* private fields */ }Expand description
Implements a client for the Stackdriver Trace API.
§Service Description
Service for collecting and viewing traces and spans within a trace.
A trace is a collection of spans corresponding to a single operation or a set of operations in an application.
A span is an individual timed event which forms a node of the trace tree. A single trace can contain spans from multiple services.
§Configuration
TraceService has various configuration parameters, the defaults should
work with most applications.
§Pooling and Cloning
TraceService holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap TraceService in
an Rc or Arc to reuse it, because it already uses an Arc
internally.
Implementations§
Source§impl TraceService
impl TraceService
Sourcepub async fn new_with_config(conf: ClientConfig) -> Result<Self>
pub async fn new_with_config(conf: ClientConfig) -> Result<Self>
Creates a new client with the specified configuration.
Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: TraceService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: TraceService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is when mocking the client.
Sourcepub fn batch_write_spans(&self, name: impl Into<String>) -> BatchWriteSpans
pub fn batch_write_spans(&self, name: impl Into<String>) -> BatchWriteSpans
Batch writes new spans to new or existing traces. You cannot update existing spans.
Sourcepub fn create_span(&self, name: impl Into<String>) -> CreateSpan
pub fn create_span(&self, name: impl Into<String>) -> CreateSpan
Creates a new span.
Trait Implementations§
Source§impl Clone for TraceService
impl Clone for TraceService
Source§fn clone(&self) -> TraceService
fn clone(&self) -> TraceService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more