opentelemetry_sdk

Type Alias 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::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

Source

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 since 0.23.0: Please use builder() instead

Deprecated, use InstrumentationLibrary::builder()

Create an new instrumentation library.

Source

pub fn builder<T>(name: T) -> InstrumentationLibraryBuilder
where T: Into<Cow<'static, str>>,

Create a new builder to create an InstrumentationLibrary

Trait Implementations

Source§

impl Clone for InstrumentationLibrary

Source§

fn clone(&self) -> InstrumentationLibrary

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InstrumentationLibrary

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for InstrumentationLibrary

Source§

fn default() -> InstrumentationLibrary

Returns the “default value” for a type. Read more
Source§

impl Hash for InstrumentationLibrary

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for InstrumentationLibrary

Source§

fn eq(&self, other: &InstrumentationLibrary) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for InstrumentationLibrary