fixes for influx, metrics reporting, etc

This commit is contained in:
2026-09-24 01:02:48 -07:00
parent b3481686b2
commit 7242ed4108
2 changed files with 23 additions and 6 deletions
+2 -2
View File
@@ -78,7 +78,7 @@ impl SourceReportDetails for HwmonReport {
for (sensor, value) in &self.values { for (sensor, value) in &self.values {
metrics.push(SourceMetricSet { metrics.push(SourceMetricSet {
tags: sensor.tags.clone(), 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 { // for (sensor, alarm) in &self.alarms {
@@ -145,7 +145,7 @@ impl ChimemonSource for HwmonSource {
} }
}, },
Err(e) => { 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 continue
} }
} }
+21 -4
View File
@@ -130,10 +130,13 @@ impl SourceReportDetails for UCCMGPSSatsReport {
self.tracked_svs.len() >= 4 self.tracked_svs.len() >= 4
} }
fn to_metrics(&self) -> Vec<SourceMetricSet> { fn to_metrics(&self) -> Vec<SourceMetricSet> {
vec![SourceMetricSet { self.tracked_svs
tags: Arc::new(vec![]), .iter()
metrics: self.tracked_svs.iter().map(|sv| sv.into()).collect(), .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 if sysnow - last_sent_report
>= Duration::from_std(self.config.status_interval).unwrap() >= 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 Some(loop_diag) = &last_loop_diag {
if let Err(e) = chan.send( if let Err(e) = chan.send(
SourceReport { SourceReport {