pub struct Tracer { /* private fields */ }Expand description
Owns the telemetry lifecycle for a specific event stream.
Implementations§
Source§impl Tracer
impl Tracer
pub fn new( provider: Arc<dyn TelemetryProvider>, event_stream: BoxEventStream<Event>, ) -> Self
pub fn from_direct<T>( provider: Arc<dyn TelemetryProvider>, handle: &mut DirectAgentHandle<T>, ) -> Self
pub async fn from_environment( provider: Arc<dyn TelemetryProvider>, env: &mut Environment, runtime_id: Option<RuntimeID>, ) -> Result<Self, TelemetryError>
pub fn with_shutdown_grace(self, duration: Duration) -> Self
Sourcepub fn start(&mut self) -> Result<(), TelemetryError>
pub fn start(&mut self) -> Result<(), TelemetryError>
Start exporting spans and metrics from the configured event stream.
Sourcepub async fn shutdown(&mut self) -> Result<(), TelemetryError>
pub async fn shutdown(&mut self) -> Result<(), TelemetryError>
Flush and shut down exporters.
Auto Trait Implementations§
impl Freeze for Tracer
impl !RefUnwindSafe for Tracer
impl !Send for Tracer
impl !Sync for Tracer
impl Unpin for Tracer
impl !UnwindSafe for Tracer
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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