pub struct ObservabilityHandle {
tracer_provider: Option<SdkTracerProvider>,
logger_provider: Option<SdkLoggerProvider>,
metrics_handle: Option<MetricsHandle>,
tracing_runtime: Option<Runtime>,
}Expand description
Handle for observability runtime components.
Fields§
§tracer_provider: Option<SdkTracerProvider>§logger_provider: Option<SdkLoggerProvider>§metrics_handle: Option<MetricsHandle>§tracing_runtime: Option<Runtime>Implementations§
Source§impl ObservabilityHandle
impl ObservabilityHandle
Sourcepub fn shutdown(&mut self)
pub fn shutdown(&mut self)
Explicitly shuts down observability components.
This should be called before dropping the handle when running inside an async context to avoid panics from blocking operations.
Sourcefn flush_and_shutdown(
tracer: Option<SdkTracerProvider>,
logger: Option<SdkLoggerProvider>,
)
fn flush_and_shutdown( tracer: Option<SdkTracerProvider>, logger: Option<SdkLoggerProvider>, )
Flushes and shuts down tracer and logger providers.
Sourcefn shutdown_runtime(runtime: Option<Runtime>)
fn shutdown_runtime(runtime: Option<Runtime>)
Shuts down the tracing runtime with a timeout.
Sourcefn wait_for_batch_export(handle: &Handle)
fn wait_for_batch_export(handle: &Handle)
Waits briefly for the batch exporter to process pending exports.
Sourcefn shutdown_provider<T: ShutdownProvider>(provider: Option<T>)
fn shutdown_provider<T: ShutdownProvider>(provider: Option<T>)
Shuts down a tracer provider if present.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ObservabilityHandle
impl !RefUnwindSafe for ObservabilityHandle
impl Send for ObservabilityHandle
impl Sync for ObservabilityHandle
impl Unpin for ObservabilityHandle
impl !UnwindSafe for ObservabilityHandle
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<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].