Struct opentelemetry_api::metrics::Meter
source · [−]pub struct Meter { /* private fields */ }
metrics
only.Expand description
Provides access to instrument instances for recording metrics.
Implementations
sourceimpl Meter
impl Meter
sourcepub fn new(
instrumentation_library: InstrumentationLibrary,
instrument_provider: Arc<dyn InstrumentProvider + Send + Sync>
) -> Self
pub fn new(
instrumentation_library: InstrumentationLibrary,
instrument_provider: Arc<dyn InstrumentProvider + Send + Sync>
) -> Self
Create a new named meter from an instrumentation provider
sourcepub fn u64_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, Counter<u64>>
pub fn u64_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, Counter<u64>>
creates an instrument builder for recording increasing values.
sourcepub fn f64_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, Counter<f64>>
pub fn f64_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, Counter<f64>>
creates an instrument builder for recording increasing values.
sourcepub fn u64_observable_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableCounter<u64>>
pub fn u64_observable_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableCounter<u64>>
creates an instrument builder for recording increasing values via callback.
sourcepub fn f64_observable_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableCounter<f64>>
pub fn f64_observable_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableCounter<f64>>
creates an instrument builder for recording increasing values via callback.
sourcepub fn i64_up_down_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, UpDownCounter<i64>>
pub fn i64_up_down_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, UpDownCounter<i64>>
creates an instrument builder for recording changes of a value.
sourcepub fn f64_up_down_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, UpDownCounter<f64>>
pub fn f64_up_down_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, UpDownCounter<f64>>
creates an instrument builder for recording changes of a value.
sourcepub fn i64_observable_up_down_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableUpDownCounter<i64>>
pub fn i64_observable_up_down_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableUpDownCounter<i64>>
creates an instrument builder for recording changes of a value via callback.
sourcepub fn f64_observable_up_down_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableUpDownCounter<f64>>
pub fn f64_observable_up_down_counter(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableUpDownCounter<f64>>
creates an instrument builder for recording changes of a value via callback.
sourcepub fn u64_observable_gauge(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableGauge<u64>>
pub fn u64_observable_gauge(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableGauge<u64>>
creates an instrument builder for recording the current value via callback.
sourcepub fn i64_observable_gauge(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableGauge<i64>>
pub fn i64_observable_gauge(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableGauge<i64>>
creates an instrument builder for recording the current value via callback.
sourcepub fn f64_observable_gauge(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableGauge<f64>>
pub fn f64_observable_gauge(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, ObservableGauge<f64>>
creates an instrument builder for recording the current value via callback.
sourcepub fn f64_histogram(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, Histogram<f64>>
pub fn f64_histogram(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, Histogram<f64>>
creates an instrument builder for recording a distribution of values.
sourcepub fn u64_histogram(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, Histogram<u64>>
pub fn u64_histogram(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, Histogram<u64>>
creates an instrument builder for recording a distribution of values.
sourcepub fn i64_histogram(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, Histogram<i64>>
pub fn i64_histogram(
&self,
name: impl Into<String>
) -> InstrumentBuilder<'_, Histogram<i64>>
creates an instrument builder for recording a distribution of values.
sourcepub fn register_callback<F>(&self, callback: F) -> Result<(), MetricsError>where
F: Fn(&Context) + Send + Sync + 'static,
pub fn register_callback<F>(&self, callback: F) -> Result<(), MetricsError>where
F: Fn(&Context) + Send + Sync + 'static,
Captures the function that will be called during data collection.
It is only valid to call observe
within the scope of the passed function.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Meter
impl Send for Meter
impl Sync for Meter
impl Unpin for Meter
impl !UnwindSafe for Meter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more