Fix NixOS build version display in dashboard
Update metric filtering to use exact metric names instead of prefix matching. This resolves the issue where build version showed 'unknown' despite agent correctly collecting the metric.
This commit is contained in:
@@ -119,7 +119,7 @@ impl TuiApp {
|
||||
// Add NixOS metrics
|
||||
let nixos_metrics: Vec<&Metric> = all_metrics
|
||||
.iter()
|
||||
.filter(|m| m.name.starts_with("system_nixos") || m.name.starts_with("system_active"))
|
||||
.filter(|m| m.name == "system_nixos_build" || m.name == "system_active_users")
|
||||
.copied()
|
||||
.collect();
|
||||
system_metrics.extend(nixos_metrics);
|
||||
|
||||
@@ -297,6 +297,10 @@ impl Widget for SystemWidget {
|
||||
self.has_data = !metrics.is_empty();
|
||||
|
||||
for metric in metrics {
|
||||
// Debug logging for NixOS metrics
|
||||
if metric.name.starts_with("system_") {
|
||||
tracing::debug!("SystemWidget received metric: {} = {:?}", metric.name, metric.value);
|
||||
}
|
||||
match metric.name.as_str() {
|
||||
// NixOS metrics
|
||||
"system_nixos_build" => {
|
||||
|
||||
Reference in New Issue
Block a user