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