reth_node_metrics/
version.rs1use metrics::gauge;
3
4#[derive(Debug, Clone)]
6pub struct VersionInfo {
7 pub version: &'static str,
9 pub build_timestamp: &'static str,
11 pub cargo_features: &'static str,
13 pub git_sha: &'static str,
15 pub target_triple: &'static str,
17 pub build_profile: &'static str,
19}
20
21impl VersionInfo {
22 pub fn register_version_metrics(&self) {
24 let labels: [(&str, &str); 6] = [
25 ("version", self.version),
26 ("build_timestamp", self.build_timestamp),
27 ("cargo_features", self.cargo_features),
28 ("git_sha", self.git_sha),
29 ("target_triple", self.target_triple),
30 ("build_profile", self.build_profile),
31 ];
32
33 let _gauge = gauge!("info", &labels);
34 }
35}