Trait metrics_prometheus::metric::Bundle
source · pub trait Bundle: Sealed {
type Single: Metric;
type Vec: MetricVec<Metric = Self::Single>;
// Required method
fn get_single_metric(&self, key: &Key) -> Result<Self::Single>;
}Expand description
Bundle of a prometheus::Metrics family.
Either a single prometheus::Metric or a
prometheus::MetricVec of them.
Required Associated Types§
sourcetype Single: Metric
type Single: Metric
Type of a single prometheus::Metric that may be stored in this
Bundle.
Required Methods§
sourcefn get_single_metric(&self, key: &Key) -> Result<Self::Single>
fn get_single_metric(&self, key: &Key) -> Result<Self::Single>
Returns a single prometheus::Metric of this Bundle,
identified by the provided metrics::Key.
Errors
If the provided metrics::Key cannot identify any
prometheus::Metric in this Bundle.