Trait mz_ore::metrics::PromLabelsExt

source ·
pub trait PromLabelsExt<'a> {
    // Required methods
    fn get_from_metric_vec<V: MetricVec_>(&self, vec: &V) -> V::M;
    fn remove_from_metric_vec<V: MetricVec_>(
        &self,
        vec: &V,
    ) -> Result<(), Error>;
}
Available on crate feature metrics only.
Expand description

An extension trait for types that are valid (or convertible into) prometheus labels: slices/vectors of strings, and BTreeMaps.

Required Methods§

source

fn get_from_metric_vec<V: MetricVec_>(&self, vec: &V) -> V::M

Returns or creates a metric with the given metric label values. Panics if retrieving the metric returns an error.

source

fn remove_from_metric_vec<V: MetricVec_>(&self, vec: &V) -> Result<(), Error>

Removes a metric with these labels from a metrics vector.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl PromLabelsExt<'static> for BTreeMap<String, String>

source§

impl PromLabelsExt<'static> for Vec<String>

source§

impl<'a> PromLabelsExt<'a> for &'a [&'a str]

source§

impl<'a> PromLabelsExt<'a> for BTreeMap<&'a str, &'a str>

source§

impl<'a> PromLabelsExt<'a> for Vec<&'a str>

Implementors§