pub struct Label(/* private fields */);
Expand description
Metadata for a metric key in the form of a key/value pair.
Metrics are always defined by a name, but can optionally be assigned “labels”, which are key/value pairs that provide metadata about the key. Labels are typically used for differentiating the context of when an where a metric are emitted.
For example, in a web service, you might wish to label metrics with the user ID responsible for the request currently being processed, or the request path being processed. Another example may be that if you were running a piece o code that was turned on or off by a feature toggle, you may wish to include a label in metrics to indicate whether or not they were using the feature toggle.
Implementations§
Source§impl Label
impl Label
Sourcepub const fn from_static_parts(key: &'static str, value: &'static str) -> Self
pub const fn from_static_parts(key: &'static str, value: &'static str) -> Self
Creates a Label
from a static key and value.
Sourcepub fn into_parts(self) -> (SharedString, SharedString)
pub fn into_parts(self) -> (SharedString, SharedString)
Consumes this Label
, returning the key and value.