pub struct TraceService { /* private fields */ }Expand description
Implements a client for the Stackdriver Trace API.
§Example
let client = TraceService::builder().build().await?;
// use `client` to make requests to 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
To configure TraceService use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://cloudtrace.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§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 fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for TraceService.
let client = TraceService::builder().build().await?;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 in tests mocking the client’s behavior.
Sourcepub fn batch_write_spans(&self) -> BatchWriteSpans
pub fn batch_write_spans(&self) -> BatchWriteSpans
Batch writes new spans to new or existing traces. You cannot update existing spans.
Sourcepub fn create_span(&self) -> CreateSpan
pub fn create_span(&self) -> 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