Struct opentelemetry_api::metrics::Meter
source · pub struct Meter { /* private fields */ }
Expand description
Provides access to instrument instances for recording metrics.
Implementations§
source§impl 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.