diff --git a/agent/src/collectors/service.rs b/agent/src/collectors/service.rs index c352192..cfb4350 100644 --- a/agent/src/collectors/service.rs +++ b/agent/src/collectors/service.rs @@ -986,21 +986,11 @@ impl ServiceCollector { } - // Check which sites are actually accessible - let mut accessible_sites = Vec::new(); - for site in sites { - if self.check_site_accessibility(&site).await { - accessible_sites.push(site); // Remove checkmark - status will be shown via sub_service row status - } - } - - // Limit to reasonable number - accessible_sites.truncate(15); - - if accessible_sites.is_empty() { + // Return all sites from nginx config (monitor all, regardless of current status) + if sites.is_empty() { None } else { - Some(accessible_sites) + Some(sites) } } @@ -1048,34 +1038,6 @@ impl ServiceCollector { } } - async fn check_site_accessibility(&self, hostname: &str) -> bool { - // Create HTTP client with same timeout as site latency checks - let client = match reqwest::Client::builder() - .timeout(Duration::from_secs(2)) - .build() - { - Ok(client) => client, - Err(_) => return false, - }; - - // Try HTTPS first, then HTTP - for scheme in ["https", "http"] { - let url = format!("{}://{}", scheme, hostname); - - match client.get(&url).send().await { - Ok(response) => { - let status = response.status().as_u16(); - // Check for successful HTTP status codes (same logic as before) - if status == 200 || status == 301 || status == 302 || status == 403 { - return true; - } - } - Err(_) => continue, - } - } - - false - } async fn get_nginx_description(&self) -> Option { // Get site count and active connections diff --git a/dashboard/src/ui/services.rs b/dashboard/src/ui/services.rs index a57e503..f1bb278 100644 --- a/dashboard/src/ui/services.rs +++ b/dashboard/src/ui/services.rs @@ -109,10 +109,17 @@ fn render_metrics( // Add latency information for nginx sites if available let service_name_with_latency = if let Some(parent) = &svc.sub_service { if parent == "nginx" { + // Extract subdomain part for shorter display + let short_name = if let Some(dot_pos) = svc.name.find('.') { + &svc.name[..dot_pos] + } else { + &svc.name + }; + match &svc.latency_ms { - Some(latency) if *latency >= 2000.0 => format!("{} → unreachable", svc.name), // Timeout (2s+) - Some(latency) => format!("{} → {:.0}ms", svc.name, latency), - None => format!("{} → unreachable", svc.name), // Connection failed + Some(latency) if *latency >= 2000.0 => format!("{} → unreachable", short_name), // Timeout (2s+) + Some(latency) => format!("{} → {:.0}ms", short_name, latency), + None => format!("{} → unreachable", short_name), // Connection failed } } else { svc.name.clone()