mz_ore::metrics::delete_on_drop

Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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§