diff --git a/agent/src/collectors/systemd.rs b/agent/src/collectors/systemd.rs index 2d64bc3..7879af1 100644 --- a/agent/src/collectors/systemd.rs +++ b/agent/src/collectors/systemd.rs @@ -127,6 +127,7 @@ impl SystemdCollector { /// Auto-discover interesting services to monitor fn discover_services(&self) -> Result> { + debug!("Starting systemd service discovery with status caching"); // Get all services (includes inactive, running, failed - everything) let units_output = Command::new("systemctl") .arg("list-units") @@ -175,6 +176,7 @@ impl SystemdCollector { }); all_service_names.insert(service_name.to_string()); + debug!("Parsed service: {} (load:{}, active:{}, sub:{})", service_name, load_state, active_state, sub_state); } } @@ -219,6 +221,11 @@ impl SystemdCollector { state.service_status_cache = status_cache; } + debug!("Service discovery completed: found {} matching services: {:?}", services.len(), services); + if services.is_empty() { + debug!("No services found matching the configured filters - this may indicate a parsing issue"); + } + Ok(services) }