fixes for influx, metrics reporting, etc
This commit is contained in:
@@ -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
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user