pub enum InstrumentKind {
ValueRecorder,
ValueObserver,
Counter,
UpDownCounter,
SumObserver,
UpDownSumObserver,
}
Available on crate feature
metrics
only.Expand description
Kinds of OpenTelemetry metric instruments
Name | Instrument kind | Function(argument) | Default aggregation | Notes |
---|---|---|---|---|
ValueRecorder | Synchronous | Record(value) | MinMaxSumCount | Per-request, any non-additive measurement |
ValueObserver | Asynchronous | Observe(value) | MinMaxSumCount | Per-interval, any non-additive measurement |
Counter | Synchronous additive monotonic | Add(increment) | Sum | Per-request, part of a monotonic sum |
UpDownCounter | Synchronous additive | Add(increment) | Sum | Per-request, part of a non-monotonic sum |
SumObserver | Asynchronous additive monotonic | Observe(sum) | Sum | Per-interval, reporting a monotonic sum |
UpDownSumObserver | Asynchronous additive | Observe(sum) | Sum | Per-interval, reporting a non-monotonic sum |
Variants§
ValueRecorder
A synchronous per-request recorder of non-additive measurements.
ValueObserver
An asynchronous per-interval recorder of non-additive measurements.
Counter
A synchronous per-request part of a monotonic sum.
UpDownCounter
A synchronous per-request part of a non-monotonic sum.
SumObserver
An asynchronous per-interval recorder of a monotonic sum.
UpDownSumObserver
An asynchronous per-interval recorder of a non-monotonic sum.
Implementations§
Source§impl InstrumentKind
impl InstrumentKind
Sourcepub fn synchronous(&self) -> bool
pub fn synchronous(&self) -> bool
Whether this is a synchronous kind of instrument.
Sourcepub fn asynchronous(&self) -> bool
pub fn asynchronous(&self) -> bool
Whether this is a synchronous kind of instrument.
Sourcepub fn adding(&self) -> bool
pub fn adding(&self) -> bool
Whether this kind of instrument adds its inputs (as opposed to grouping).
Sourcepub fn grouping(&self) -> bool
pub fn grouping(&self) -> bool
Whether this kind of instrument groups its inputs (as opposed to adding).
Sourcepub fn precomputed_sum(&self) -> bool
pub fn precomputed_sum(&self) -> bool
Whether this kind of instrument receives precomputed sums.
Trait Implementations§
Source§impl Clone for InstrumentKind
impl Clone for InstrumentKind
Source§fn clone(&self) -> InstrumentKind
fn clone(&self) -> InstrumentKind
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for InstrumentKind
impl Debug for InstrumentKind
Source§impl Hash for InstrumentKind
impl Hash for InstrumentKind
Source§impl PartialEq for InstrumentKind
impl PartialEq for InstrumentKind
impl StructuralPartialEq for InstrumentKind
Auto Trait Implementations§
impl Freeze for InstrumentKind
impl RefUnwindSafe for InstrumentKind
impl Send for InstrumentKind
impl Sync for InstrumentKind
impl Unpin for InstrumentKind
impl UnwindSafe for InstrumentKind
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>
Available on crate feature
trace
only.Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Available on crate feature
trace
only.