pub struct TelemetryGuard { /* private fields */ }Expand description
RAII handle that flushes and shuts down the global tracer provider on drop.
Holding the guard for the lifetime of main() (CLI) or for as long as
AppState is alive (HTTP server) ensures the final batch of spans is
exported before the process exits.
Implementations§
Source§impl TelemetryGuard
impl TelemetryGuard
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Override the flush+shutdown budget (mostly useful in tests).
Sourcepub fn has_provider(&self) -> bool
pub fn has_provider(&self) -> bool
Test-only inspector: always false without telemetry.
Trait Implementations§
Source§impl Drop for TelemetryGuard
impl Drop for TelemetryGuard
Auto Trait Implementations§
impl Freeze for TelemetryGuard
impl RefUnwindSafe for TelemetryGuard
impl Send for TelemetryGuard
impl Sync for TelemetryGuard
impl Unpin for TelemetryGuard
impl UnsafeUnpin for TelemetryGuard
impl UnwindSafe for TelemetryGuard
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