pub struct DistributedTracingProvider { /* private fields */ }Expand description
Distributed tracing provider
Implementations§
Source§impl DistributedTracingProvider
impl DistributedTracingProvider
Sourcepub fn new(
base_provider: Arc<dyn TelemetryProvider>,
sampler: Arc<dyn TracingSampler>,
propagator: Arc<dyn ContextPropagator>,
) -> Self
pub fn new( base_provider: Arc<dyn TelemetryProvider>, sampler: Arc<dyn TracingSampler>, propagator: Arc<dyn ContextPropagator>, ) -> Self
Create a new distributed tracing provider
Sourcepub async fn start_distributed_span(
&self,
operation_name: &str,
kind: SpanKind,
parent_context: Option<&TelemetryContext>,
) -> DistributedSpan
pub async fn start_distributed_span( &self, operation_name: &str, kind: SpanKind, parent_context: Option<&TelemetryContext>, ) -> DistributedSpan
Start a new distributed span
Sourcepub async fn add_span_event(
&self,
span_id: &str,
event_name: &str,
attributes: Vec<(&str, &str)>,
)
pub async fn add_span_event( &self, span_id: &str, event_name: &str, attributes: Vec<(&str, &str)>, )
Add event to span
Sourcepub async fn add_span_link(
&self,
span_id: &str,
link_trace_id: &str,
link_span_id: &str,
attributes: Vec<(&str, &str)>,
)
pub async fn add_span_link( &self, span_id: &str, link_trace_id: &str, link_span_id: &str, attributes: Vec<(&str, &str)>, )
Add link to span
Sourcepub async fn end_distributed_span(&self, span_id: &str, status: SpanStatus)
pub async fn end_distributed_span(&self, span_id: &str, status: SpanStatus)
End a distributed span
Sourcepub async fn get_span_context(&self, span_id: &str) -> Option<TelemetryContext>
pub async fn get_span_context(&self, span_id: &str) -> Option<TelemetryContext>
Get trace context for a span
Sourcepub async fn export_spans(&self) -> Vec<DistributedSpan>
pub async fn export_spans(&self) -> Vec<DistributedSpan>
Export completed spans (for background processing)
Auto Trait Implementations§
impl !RefUnwindSafe for DistributedTracingProvider
impl !UnwindSafe for DistributedTracingProvider
impl Freeze for DistributedTracingProvider
impl Send for DistributedTracingProvider
impl Sync for DistributedTracingProvider
impl Unpin for DistributedTracingProvider
impl UnsafeUnpin for DistributedTracingProvider
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more