Trait opentelemetry_api::metrics::MeterProvider
source · pub trait MeterProvider {
// Required method
fn versioned_meter(
&self,
name: impl Into<Cow<'static, str>>,
version: Option<impl Into<Cow<'static, str>>>,
schema_url: Option<impl Into<Cow<'static, str>>>,
attributes: Option<Vec<KeyValue>>
) -> Meter;
// Provided method
fn meter(&self, name: impl Into<Cow<'static, str>>) -> Meter { ... }
}
Expand description
Provides access to named Meter instances, for instrumenting an application or crate.
Required Methods§
sourcefn versioned_meter(
&self,
name: impl Into<Cow<'static, str>>,
version: Option<impl Into<Cow<'static, str>>>,
schema_url: Option<impl Into<Cow<'static, str>>>,
attributes: Option<Vec<KeyValue>>
) -> Meter
fn versioned_meter( &self, name: impl Into<Cow<'static, str>>, version: Option<impl Into<Cow<'static, str>>>, schema_url: Option<impl Into<Cow<'static, str>>>, attributes: Option<Vec<KeyValue>> ) -> Meter
Creates an implementation of the Meter
interface.
The instrumentation name must be the name of the library providing instrumentation. This name may be the same as the instrumented code only if that code provides built-in instrumentation. If the instrumentation name is empty, then a implementation defined default name will be used instead.
Provided Methods§
sourcefn meter(&self, name: impl Into<Cow<'static, str>>) -> Meter
fn meter(&self, name: impl Into<Cow<'static, str>>) -> Meter
Returns a new Meter with the provided name and default configuration.
A Meter should be scoped at most to a single application or crate. The name needs to be unique so it does not collide with other names used by an application, nor other applications.
If the name is empty, then an implementation defined default name will be used instead.