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::InstrumentationLibrary::builder("my-crate").
with_version(env!("CARGO_PKG_VERSION")).
with_schema_url("https://opentelemetry.io/schemas/1.17.0").
build();
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.
Implementations
Source§impl InstrumentationLibrary
impl InstrumentationLibrary
Sourcepub fn new(
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>>,
) -> InstrumentationLibrary
👎Deprecated since 0.23.0: Please use builder() instead
pub fn new( 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>>, ) -> InstrumentationLibrary
Deprecated, use InstrumentationLibrary::builder()
Create an new instrumentation library.
Sourcepub fn builder<T>(name: T) -> InstrumentationLibraryBuilder
pub fn builder<T>(name: T) -> InstrumentationLibraryBuilder
Create a new builder to create an InstrumentationLibrary
Trait Implementations
Source§impl Clone for InstrumentationLibrary
impl Clone for InstrumentationLibrary
Source§fn clone(&self) -> InstrumentationLibrary
fn clone(&self) -> InstrumentationLibrary
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for InstrumentationLibrary
impl Debug for InstrumentationLibrary
Source§impl Default for InstrumentationLibrary
impl Default for InstrumentationLibrary
Source§fn default() -> InstrumentationLibrary
fn default() -> InstrumentationLibrary
Returns the “default value” for a type. Read more