Remove debug logging from Docker collection code
All checks were successful
Build and Release / build-and-release (push) Successful in 1m19s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m19s
This commit is contained in:
@@ -4,7 +4,7 @@ use cm_dashboard_shared::{AgentData, ServiceData, SubServiceData, SubServiceMetr
|
||||
use std::process::Command;
|
||||
use std::sync::RwLock;
|
||||
use std::time::Instant;
|
||||
use tracing::{debug, info};
|
||||
use tracing::debug;
|
||||
|
||||
use super::{Collector, CollectorError};
|
||||
use crate::config::SystemdConfig;
|
||||
@@ -118,10 +118,7 @@ impl SystemdCollector {
|
||||
}
|
||||
|
||||
if service_name.contains("docker") && active_status == "active" {
|
||||
info!("Collecting Docker sub-services for service: {}", service_name);
|
||||
|
||||
let docker_containers = self.get_docker_containers();
|
||||
info!("Found {} Docker containers", docker_containers.len());
|
||||
for (container_name, container_status) in docker_containers {
|
||||
// For now, docker containers have no additional metrics
|
||||
// Future: could add memory_mb, cpu_percent, restart_count, etc.
|
||||
@@ -136,7 +133,6 @@ impl SystemdCollector {
|
||||
|
||||
// Add Docker images
|
||||
let docker_images = self.get_docker_images();
|
||||
info!("Found {} Docker images", docker_images.len());
|
||||
for (image_name, image_status, image_size) in docker_images {
|
||||
let mut metrics = Vec::new();
|
||||
metrics.push(SubServiceMetric {
|
||||
@@ -151,8 +147,6 @@ impl SystemdCollector {
|
||||
metrics,
|
||||
});
|
||||
}
|
||||
|
||||
info!("Total Docker sub-services added: {}", sub_services.len());
|
||||
}
|
||||
|
||||
// Create complete service data
|
||||
@@ -823,9 +817,6 @@ impl SystemdCollector {
|
||||
/// Get docker images as sub-services
|
||||
fn get_docker_images(&self) -> Vec<(String, String, String)> {
|
||||
let mut images = Vec::new();
|
||||
|
||||
info!("Collecting Docker images");
|
||||
|
||||
// Check if docker is available (cm-agent user is in docker group)
|
||||
let output = Command::new("docker")
|
||||
.args(&["images", "--format", "{{.Repository}}:{{.Tag}},{{.Size}}"])
|
||||
@@ -833,13 +824,10 @@ impl SystemdCollector {
|
||||
|
||||
let output = match output {
|
||||
Ok(out) if out.status.success() => out,
|
||||
Ok(out) => {
|
||||
let stderr = String::from_utf8_lossy(&out.stderr);
|
||||
info!("Docker images command failed with status: {}, stderr: {}", out.status, stderr);
|
||||
Ok(_) => {
|
||||
return images;
|
||||
}
|
||||
Err(e) => {
|
||||
info!("Docker images command error: {}", e);
|
||||
Err(_) => {
|
||||
return images;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user