Trait opentelemetry::metrics::InstrumentProvider
source · pub trait InstrumentProvider {
Show 17 methods
// Required method
fn register_callback(
&self,
instruments: &[Arc<dyn Any>],
callbacks: Box<dyn Fn(&dyn Observer) + Send + Sync>,
) -> Result<Box<dyn CallbackRegistration>>;
// Provided methods
fn u64_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<Counter<u64>> { ... }
fn f64_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<Counter<f64>> { ... }
fn u64_observable_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<u64>>,
) -> Result<ObservableCounter<u64>> { ... }
fn f64_observable_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<f64>>,
) -> Result<ObservableCounter<f64>> { ... }
fn i64_up_down_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<UpDownCounter<i64>> { ... }
fn f64_up_down_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<UpDownCounter<f64>> { ... }
fn i64_observable_up_down_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<i64>>,
) -> Result<ObservableUpDownCounter<i64>> { ... }
fn f64_observable_up_down_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<f64>>,
) -> Result<ObservableUpDownCounter<f64>> { ... }
fn u64_gauge(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<Gauge<u64>> { ... }
fn f64_gauge(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<Gauge<f64>> { ... }
fn i64_gauge(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<Gauge<i64>> { ... }
fn u64_observable_gauge(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<u64>>,
) -> Result<ObservableGauge<u64>> { ... }
fn i64_observable_gauge(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<i64>>,
) -> Result<ObservableGauge<i64>> { ... }
fn f64_observable_gauge(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<f64>>,
) -> Result<ObservableGauge<f64>> { ... }
fn f64_histogram(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<Histogram<f64>> { ... }
fn u64_histogram(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<Histogram<u64>> { ... }
}
Expand description
SDK implemented trait for creating instruments
Required Methods§
Provided Methods§
sourcefn u64_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<Counter<u64>>
fn u64_counter( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, ) -> Result<Counter<u64>>
creates an instrument for recording increasing values.
sourcefn f64_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<Counter<f64>>
fn f64_counter( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, ) -> Result<Counter<f64>>
creates an instrument for recording increasing values.
sourcefn u64_observable_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<u64>>,
) -> Result<ObservableCounter<u64>>
fn u64_observable_counter( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, _callback: Vec<Callback<u64>>, ) -> Result<ObservableCounter<u64>>
creates an instrument for recording increasing values via callback.
sourcefn f64_observable_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<f64>>,
) -> Result<ObservableCounter<f64>>
fn f64_observable_counter( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, _callback: Vec<Callback<f64>>, ) -> Result<ObservableCounter<f64>>
creates an instrument for recording increasing values via callback.
sourcefn i64_up_down_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<UpDownCounter<i64>>
fn i64_up_down_counter( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, ) -> Result<UpDownCounter<i64>>
creates an instrument for recording changes of a value.
sourcefn f64_up_down_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<UpDownCounter<f64>>
fn f64_up_down_counter( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, ) -> Result<UpDownCounter<f64>>
creates an instrument for recording changes of a value.
sourcefn i64_observable_up_down_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<i64>>,
) -> Result<ObservableUpDownCounter<i64>>
fn i64_observable_up_down_counter( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, _callback: Vec<Callback<i64>>, ) -> Result<ObservableUpDownCounter<i64>>
creates an instrument for recording changes of a value.
sourcefn f64_observable_up_down_counter(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<f64>>,
) -> Result<ObservableUpDownCounter<f64>>
fn f64_observable_up_down_counter( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, _callback: Vec<Callback<f64>>, ) -> Result<ObservableUpDownCounter<f64>>
creates an instrument for recording changes of a value via callback.
sourcefn u64_gauge(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<Gauge<u64>>
fn u64_gauge( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, ) -> Result<Gauge<u64>>
creates an instrument for recording independent values.
sourcefn f64_gauge(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<Gauge<f64>>
fn f64_gauge( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, ) -> Result<Gauge<f64>>
creates an instrument for recording independent values.
sourcefn i64_gauge(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
) -> Result<Gauge<i64>>
fn i64_gauge( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, ) -> Result<Gauge<i64>>
creates an instrument for recording independent values.
sourcefn u64_observable_gauge(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<u64>>,
) -> Result<ObservableGauge<u64>>
fn u64_observable_gauge( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, _callback: Vec<Callback<u64>>, ) -> Result<ObservableGauge<u64>>
creates an instrument for recording the current value via callback.
sourcefn i64_observable_gauge(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<i64>>,
) -> Result<ObservableGauge<i64>>
fn i64_observable_gauge( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, _callback: Vec<Callback<i64>>, ) -> Result<ObservableGauge<i64>>
creates an instrument for recording the current value via callback.
sourcefn f64_observable_gauge(
&self,
_name: Cow<'static, str>,
_description: Option<Cow<'static, str>>,
_unit: Option<Cow<'static, str>>,
_callback: Vec<Callback<f64>>,
) -> Result<ObservableGauge<f64>>
fn f64_observable_gauge( &self, _name: Cow<'static, str>, _description: Option<Cow<'static, str>>, _unit: Option<Cow<'static, str>>, _callback: Vec<Callback<f64>>, ) -> Result<ObservableGauge<f64>>
creates an instrument for recording the current value via callback.