Skip to main content

PromLabelsExt

Trait PromLabelsExt 

Source
pub trait PromLabelsExt {
    // 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".

Implementations on Foreign Types§

Source§

impl PromLabelsExt for &[&str]

Source§

impl PromLabelsExt for BTreeMap<&str, &str>

Source§

impl PromLabelsExt for BTreeMap<String, String>

Source§

impl PromLabelsExt for Vec<&str>

Source§

impl PromLabelsExt for Vec<String>

Implementors§