Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Open Metrics [`Info`] metric "to expose textual information which SHOULD NOT change during process lifetime". ``` use open_metrics_client::metrics::info::Info; let _info = Info::new(vec![("os", "GNU/linux")]); ```
- Loading branch information
Showing
6 changed files
with
76 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//! 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 open_metrics_client::metrics::info::Info; | ||
/// | ||
/// let _info = Info::new(vec![("os", "GNU/linux")]); | ||
/// ``` | ||
pub struct Info<S>(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; | ||
} |