1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
//! Module implementing an Open Metrics info metric.
//!
//! See [`Info`] for details.
use crate::metrics::{MetricType, TypedMetric};
/// Open Metrics [`Info`] metric "to expose textual information which SHOULD NOT
/// change during process lifetime".
///
/// ```
/// # use prometheus_client::metrics::info::Info;
///
/// let _info = Info::new(vec![("os", "GNU/linux")]);
/// ```
#[derive(Debug)]
pub struct Info<S>(pub(crate) S);
impl<S> Info<S> {
pub fn new(label_set: S) -> Self {
Self(label_set)
}
}
impl<S> TypedMetric for Info<S> {
const TYPE: MetricType = MetricType::Info;
}