reth_node_metrics/
version.rsuse metrics::gauge;
#[derive(Debug, Clone)]
pub struct VersionInfo {
pub version: &'static str,
pub build_timestamp: &'static str,
pub cargo_features: &'static str,
pub git_sha: &'static str,
pub target_triple: &'static str,
pub build_profile: &'static str,
}
impl VersionInfo {
pub fn register_version_metrics(&self) {
let labels: [(&str, &str); 6] = [
("version", self.version),
("build_timestamp", self.build_timestamp),
("cargo_features", self.cargo_features),
("git_sha", self.git_sha),
("target_triple", self.target_triple),
("build_profile", self.build_profile),
];
let _gauge = gauge!("info", &labels);
}
}