logo
pub fn meter_with_version(
    name: &'static str,
    version: Option<&'static str>,
    schema_url: Option<&'static str>
) -> Meter
Expand description

Creates a Meter with the name, version and schema url.

  • name SHOULD uniquely identify the instrumentation scope, such as the instrumentation library (e.g. io.opentelemetry.contrib.mongodb), package, module or class name.
  • version specifies the version of the instrumentation scope if the scope has a version
  • schema url specifies the Schema URL that should be recorded in the emitted telemetry.

This is a convenient way of global::meter_provider().meter(...)

Example

use opentelemetry_api::global::meter_with_version;
let meter = meter_with_version("io.opentelemetry", Some("0.17"), Some("https://opentelemetry.io/schemas/1.2.0"));