pub struct TraceService { /* private fields */ }Expand description
Implements a client for the Cloud Trace API.
§Example
let client = TraceService::builder().build().await?;
// use `client` to make requests to the Cloud Trace API.§Service Description
This file describes an API for collecting and viewing traces and spans within a trace. A Trace is a collection of spans corresponding to a single operation or set of operations for an application. A span is an individual timed event which forms a node of the trace tree. Spans for a single trace may span 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 list_traces(&self) -> ListTraces
pub fn list_traces(&self) -> ListTraces
Returns of a list of traces that match the specified filter conditions.
Sourcepub fn patch_traces(&self) -> PatchTraces
pub fn patch_traces(&self) -> PatchTraces
Sends new traces to Stackdriver Trace or updates existing traces. If the ID of a trace that you send matches that of an existing trace, any fields in the existing trace and its spans are overwritten by the provided values, and any new fields provided are merged with the existing trace data. If the ID does not match, a new trace is created.
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