pub struct OtelObserver { /* private fields */ }Expand description
Implementations§
Source§impl OtelObserver
impl OtelObserver
Sourcepub fn new(meter: &Meter) -> Self
pub fn new(meter: &Meter) -> Self
Builds every instrument of the catalogue on meter.
Instruments are created once and reused, which is what the OpenTelemetry API asks for: creating duplicates of the same instrument costs the SDK performance.
Sourcepub fn instrument_count(&self) -> usize
pub fn instrument_count(&self) -> usize
How many instruments were built. Equal to the size of the catalogue.
Sourcepub fn attributes(signal: Signal, labels: &SignalLabels) -> Vec<KeyValue>
pub fn attributes(signal: Signal, labels: &SignalLabels) -> Vec<KeyValue>
The attributes emitted for a signal: exactly the labels of
crate::metrics::metric_labels, as OpenTelemetry key/value pairs.
Trait Implementations§
Source§impl Debug for OtelObserver
impl Debug for OtelObserver
Source§impl Observer for OtelObserver
impl Observer for OtelObserver
Source§fn observe_labeled(&self, signal: &Signal, labels: &SignalLabels)
fn observe_labeled(&self, signal: &Signal, labels: &SignalLabels)
Observes a signal with labels. The default drops the labels.
Source§fn observe_duration(
&self,
signal: &Signal,
duration: Duration,
labels: &SignalLabels,
)
fn observe_duration( &self, signal: &Signal, duration: Duration, labels: &SignalLabels, )
Observes a duration signal (
SignalKind::DurationMillis or
SignalKind::DurationMicros) with its measured value. The default
drops the value and forwards to Observer::observe_labeled.Auto Trait Implementations§
impl !RefUnwindSafe for OtelObserver
impl !UnwindSafe for OtelObserver
impl Freeze for OtelObserver
impl Send for OtelObserver
impl Sync for OtelObserver
impl Unpin for OtelObserver
impl UnsafeUnpin for OtelObserver
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