Add agent hash display to system panel
Implement agent version tracking to diagnose deployment issues: - Add get_agent_hash() method to extract Nix store hash from executable path - Collect system_agent_hash metric in NixOS collector - Display "Agent Hash" in system panel under NixOS section - Update metric filtering to include agent hash This helps identify which version of the agent is actually running when troubleshooting deployment or metric collection issues.
This commit is contained in:
@@ -16,6 +16,7 @@ pub struct SystemWidget {
|
||||
// NixOS information
|
||||
nixos_build: Option<String>,
|
||||
active_users: Option<String>,
|
||||
agent_hash: Option<String>,
|
||||
|
||||
// CPU metrics
|
||||
cpu_load_1min: Option<f32>,
|
||||
@@ -64,6 +65,7 @@ impl SystemWidget {
|
||||
Self {
|
||||
nixos_build: None,
|
||||
active_users: None,
|
||||
agent_hash: None,
|
||||
cpu_load_1min: None,
|
||||
cpu_load_5min: None,
|
||||
cpu_load_15min: None,
|
||||
@@ -313,6 +315,11 @@ impl Widget for SystemWidget {
|
||||
self.active_users = Some(users.clone());
|
||||
}
|
||||
}
|
||||
"system_agent_hash" => {
|
||||
if let MetricValue::String(hash) = &metric.value {
|
||||
self.agent_hash = Some(hash.clone());
|
||||
}
|
||||
}
|
||||
|
||||
// CPU metrics
|
||||
"cpu_load_1min" => {
|
||||
@@ -397,6 +404,11 @@ impl Widget for SystemWidget {
|
||||
Span::styled(format!("Active users: {}", users_text), Typography::secondary())
|
||||
]));
|
||||
|
||||
let agent_hash_text = self.agent_hash.as_deref().unwrap_or("unknown");
|
||||
lines.push(Line::from(vec![
|
||||
Span::styled(format!("Agent Hash: {}", agent_hash_text), Typography::secondary())
|
||||
]));
|
||||
|
||||
// CPU section
|
||||
lines.push(Line::from(vec![
|
||||
Span::styled("CPU:", Typography::widget_title())
|
||||
|
||||
Reference in New Issue
Block a user