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.
Trait Implementations§
Source§impl Ord for Label
impl Ord for Label
Source§impl PartialOrd for Label
impl PartialOrd for Label
impl Eq for Label
impl StructuralPartialEq for Label
Auto Trait Implementations§
impl Freeze for Label
impl RefUnwindSafe for Label
impl Send for Label
impl Sync for Label
impl Unpin for Label
impl UnwindSafe for Label
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)