Trait mz_ore::metrics::delete_on_drop::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 BTreeMap
s.
Required Methods§
sourcefn get_from_metric_vec<V: MetricVec_>(&self, vec: &V) -> V::M
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.
sourcefn remove_from_metric_vec<V: MetricVec_>(&self, vec: &V) -> Result<(), Error>
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.