pub struct LabeledMetricsBuilder<'a, W>where
W: Write,{ /* private fields */ }
Expand description
A helper for encoding metrics that use labels. See MetricsEncoder::counter_vec and MetricsEncoder::gauge_vec.
Implementations§
Source§impl<W: Write> LabeledMetricsBuilder<'_, W>
impl<W: Write> LabeledMetricsBuilder<'_, W>
Sourcepub fn value(self, labels: &[(&str, &str)], value: f64) -> Result<Self>
pub fn value(self, labels: &[(&str, &str)], value: f64) -> Result<Self>
Encodes the metrics value observed for the specified values of labels.
§Panics
This function panics if one of the labels does not match pattern [a-zA-Z_][a-zA-Z0-9_]. See https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels.
Auto Trait Implementations§
impl<'a, W> Freeze for LabeledMetricsBuilder<'a, W>
impl<'a, W> RefUnwindSafe for LabeledMetricsBuilder<'a, W>where
W: RefUnwindSafe,
impl<'a, W> Send for LabeledMetricsBuilder<'a, W>where
W: Send,
impl<'a, W> Sync for LabeledMetricsBuilder<'a, W>where
W: Sync,
impl<'a, W> Unpin for LabeledMetricsBuilder<'a, W>
impl<'a, W> !UnwindSafe for LabeledMetricsBuilder<'a, W>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more