diff --git a/sn_networking/src/metrics/mod.rs b/sn_networking/src/metrics/mod.rs index bd56c0b0c9..a7fdfbeee1 100644 --- a/sn_networking/src/metrics/mod.rs +++ b/sn_networking/src/metrics/mod.rs @@ -12,7 +12,7 @@ use libp2p::metrics::{Metrics as Libp2pMetrics, Recorder}; use prometheus_client::metrics::family::Family; use prometheus_client::{ metrics::{counter::Counter, gauge::Gauge}, - registry::{Registry, Unit}, + registry::Registry, }; use sysinfo::{Pid, ProcessRefreshKind, System}; use tokio::time::Duration; @@ -118,18 +118,16 @@ impl NetworkMetricsRecorder { ); let process_memory_used_mb = Gauge::default(); - sub_registry.register_with_unit( + sub_registry.register( "process_memory_used_mb", "Memory used by the process in MegaBytes", - Unit::Other("MegaByte".to_string()), process_memory_used_mb.clone(), ); let process_cpu_usage_percentage = Gauge::default(); - sub_registry.register_with_unit( + sub_registry.register( "process_cpu_usage_percentage", "The percentage of CPU used by the process. Value is from 0-100", - Unit::Other("Percentage".to_string()), process_cpu_usage_percentage.clone(), ); diff --git a/sn_node/src/metrics.rs b/sn_node/src/metrics.rs index 4e64d4a771..4ba458448e 100644 --- a/sn_node/src/metrics.rs +++ b/sn_node/src/metrics.rs @@ -15,7 +15,7 @@ use prometheus_client::{ gauge::Gauge, histogram::{exponential_buckets, Histogram}, }, - registry::{Registry, Unit}, + registry::Registry, }; use sn_networking::Instant; @@ -102,26 +102,23 @@ impl NodeMetricsRecorder { ); let current_reward_wallet_balance = Gauge::default(); - sub_registry.register_with_unit( + sub_registry.register( "current_reward_wallet_balance", "The number of Nanos in the node reward wallet", - Unit::Other("Nano".to_string()), current_reward_wallet_balance.clone(), ); let total_forwarded_rewards = Gauge::default(); - sub_registry.register_with_unit( + sub_registry.register( "total_forwarded_rewards", "The cumulative number of Nanos forwarded by the node", - Unit::Other("Nano".to_string()), total_forwarded_rewards.clone(), ); let uptime = Gauge::default(); - sub_registry.register_with_unit( + sub_registry.register( "uptime", "The uptime of the node in seconds", - Unit::Seconds, uptime.clone(), );