Type Alias opentelemetry::sdk::Scope

source ·
pub type Scope = InstrumentationLibrary;
Expand description

A logical unit of the application code with which the emitted telemetry can be associated.

Aliased Type§

struct Scope {
    pub name: Cow<'static, str>,
    pub version: Option<Cow<'static, str>>,
    pub schema_url: Option<Cow<'static, str>>,
    pub attributes: Vec<KeyValue>,
}

Fields§

§name: Cow<'static, str>

The library name.

This should be the name of the crate providing the instrumentation.

§version: Option<Cow<'static, str>>

The library version.

Examples

let library = opentelemetry_api::InstrumentationLibrary::new(
    "my-crate",
    Some(env!("CARGO_PKG_VERSION")),
    Some("https://opentelemetry.io/schemas/1.17.0"),
    None,
);
§schema_url: Option<Cow<'static, str>>

Schema url used by this library.

§attributes: Vec<KeyValue>

Specifies the instrumentation scope attributes to associate with emitted telemetry.