From 7242ed41083d4aaf995c5f8808c7f1d6fff85898 Mon Sep 17 00:00:00 2001 From: Keenan Tims Date: Thu, 24 Sep 2026 01:02:48 -0700 Subject: [PATCH] fixes for influx, metrics reporting, etc --- src/sources/hwmon.rs | 4 ++-- src/sources/uccm.rs | 25 +++++++++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/sources/hwmon.rs b/src/sources/hwmon.rs index 650a486..47e4bf7 100644 --- a/src/sources/hwmon.rs +++ b/src/sources/hwmon.rs @@ -78,7 +78,7 @@ impl SourceReportDetails for HwmonReport { for (sensor, value) in &self.values { metrics.push(SourceMetricSet { tags: sensor.tags.clone(), - metrics: vec![SourceMetric::new_float("hwmon_value", *value)], + metrics: vec![SourceMetric::new_float("value", *value)], }) } // for (sensor, alarm) in &self.alarms { @@ -145,7 +145,7 @@ impl ChimemonSource for HwmonSource { } }, Err(e) => { - error!("Unable to get hwmon sensor value ({})", e.to_string()); + error!("Unable to get hwmon sensor value ({}) @ `{:?}`", e.to_string(), s.value_path.to_str()); continue } } diff --git a/src/sources/uccm.rs b/src/sources/uccm.rs index 0e3b218..cf4b235 100644 --- a/src/sources/uccm.rs +++ b/src/sources/uccm.rs @@ -130,10 +130,13 @@ impl SourceReportDetails for UCCMGPSSatsReport { self.tracked_svs.len() >= 4 } fn to_metrics(&self) -> Vec { - vec![SourceMetricSet { - tags: Arc::new(vec![]), - metrics: self.tracked_svs.iter().map(|sv| sv.into()).collect(), - }] + self.tracked_svs + .iter() + .map(|sv| SourceMetricSet { + tags: Arc::new(vec![("sv_id", sv.sv.to_string())]), + metrics: vec![SourceMetric::new_int("sv_cno", sv.cno as i64)], + }) + .collect() } } @@ -452,6 +455,20 @@ impl UCCMMonitor { if sysnow - last_sent_report >= Duration::from_std(self.config.status_interval).unwrap() { + if let Err(e) = chan.send( + SourceReport { + name: "uccm".to_owned(), + status: if valid { + SourceStatus::Healthy + } else { + SourceStatus::Unknown + }, + details: Arc::new(tod), + } + .into(), + ) { + error!(error = ?e, "Unable to send message to channel") + } if let Some(loop_diag) = &last_loop_diag { if let Err(e) = chan.send( SourceReport {