Struct opentelemetry::InstrumentationLibrary
source · #[non_exhaustive]pub struct InstrumentationLibrary {
pub name: Cow<'static, str>,
pub version: Option<Cow<'static, str>>,
pub schema_url: Option<Cow<'static, str>>,
pub attributes: Vec<KeyValue>,
}
Expand description
Information about a library or crate providing instrumentation.
An instrumentation library should be named to follow any naming conventions of the instrumented library (e.g. ‘middleware’ for a web framework).
See the instrumentation libraries spec for more information.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.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: Into<Cow<'static, str>>>(
name: T,
) -> InstrumentationLibraryBuilder
pub fn builder<T: Into<Cow<'static, str>>>( 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
source§impl Hash for InstrumentationLibrary
impl Hash for InstrumentationLibrary
source§impl PartialEq for InstrumentationLibrary
impl PartialEq for InstrumentationLibrary
impl Eq for InstrumentationLibrary
Auto Trait Implementations§
impl Freeze for InstrumentationLibrary
impl RefUnwindSafe for InstrumentationLibrary
impl Send for InstrumentationLibrary
impl Sync for InstrumentationLibrary
impl Unpin for InstrumentationLibrary
impl UnwindSafe for InstrumentationLibrary
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)