pub struct ObsHandle { /* private fields */ }Expand description
Shared metrics provider plus pre-built instrument handles.
One ObsHandle is constructed per Courier and cloned into every
NodeCtx. Cloning is cheap — instruments are Arc internally.
Implementations§
Source§impl ObsHandle
impl ObsHandle
Sourcepub fn noop() -> Self
pub fn noop() -> Self
Build an ObsHandle with no exporter installed. Counters and
histograms still work (so callers don’t branch on Option),
but observations are dropped. This uses a private no-op meter,
not opentelemetry::global, so embedded hosts with a global
provider do not receive Courier metrics when Courier metrics
are disabled.
Sourcepub fn force_flush(&self)
pub fn force_flush(&self)
Force-flush pending observations without tearing down the provider.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ObsHandle
impl !RefUnwindSafe for ObsHandle
impl Send for ObsHandle
impl Sync for ObsHandle
impl Unpin for ObsHandle
impl UnsafeUnpin for ObsHandle
impl !UnwindSafe for ObsHandle
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request