Skip to main content

Labels

Trait Labels 

Source
pub trait Labels {
    // Required method
    fn attributes(&self) -> Vec<KeyValue>;
}
Expand description

Label set for a metric group, typically derived on a struct with named fields:

ⓘ
#[derive(Labels)]
struct Outcome {
    method: &'static str,
    status: u16,
}

Required Methods§

Source

fn attributes(&self) -> Vec<KeyValue>

Converts the label fields into OpenTelemetry key-value attributes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§