pub struct MetricsSink { /* private fields */ }Expand description
Host-aggregated RED-style metrics (ADR 000009 “metrics are host-aggregated”), derived from
the span stream in-process: a sink that tallies rather than retains. Errors are the
RunError outcomes (trap / deadline / instantiate / unavailable); short-circuits are
counted separately (a filter blocking is not a fault).
Implementations§
Source§impl MetricsSink
impl MetricsSink
pub fn new() -> MetricsSink
pub fn snapshot(&self) -> MetricsSnapshot
Trait Implementations§
Source§impl Debug for MetricsSink
impl Debug for MetricsSink
Source§impl Default for MetricsSink
impl Default for MetricsSink
Source§fn default() -> MetricsSink
fn default() -> MetricsSink
Returns the “default value” for a type. Read more
Source§impl TelemetrySink for MetricsSink
impl TelemetrySink for MetricsSink
fn export(&self, span: &FilterSpan)
Source§fn enabled(&self) -> bool
fn enabled(&self) -> bool
Whether this sink consumes spans at all. When
false, the host skips span construction
entirely on the per-request path — build_filter_span allocates (name, attributes, one
event per host-log line), which would otherwise be paid per hook call just to be dropped
by export. Defaults to true; only a sink that discards everything should override.Auto Trait Implementations§
impl !Freeze for MetricsSink
impl RefUnwindSafe for MetricsSink
impl Send for MetricsSink
impl Sync for MetricsSink
impl Unpin for MetricsSink
impl UnsafeUnpin for MetricsSink
impl UnwindSafe for MetricsSink
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