Trait ore::metrics::delete_on_drop::PromLabelsExt [−][src]
pub trait PromLabelsExt<'a> {
fn get_from_metric_vec<P: MetricVecBuilder>(
&self,
vec: &MetricVec<P>
) -> <P as MetricVecBuilder>::M;
fn remove_from_metric_vec<P: MetricVecBuilder>(
&self,
vec: &MetricVec<P>
) -> Result<(), Error>;
}
This is supported 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 HashMap
s.
Required methods
fn get_from_metric_vec<P: MetricVecBuilder>(
&self,
vec: &MetricVec<P>
) -> <P as MetricVecBuilder>::M
fn get_from_metric_vec<P: MetricVecBuilder>(
&self,
vec: &MetricVec<P>
) -> <P as MetricVecBuilder>::M
Returns or creates a metric with the given metric label values. Panics if retrieving the metric returns an error.
fn remove_from_metric_vec<P: MetricVecBuilder>(
&self,
vec: &MetricVec<P>
) -> Result<(), Error>
fn remove_from_metric_vec<P: MetricVecBuilder>(
&self,
vec: &MetricVec<P>
) -> Result<(), Error>
Removes a metric with these labels from a metrics vector.