Change Docker collection logging from debug to info level
All checks were successful
Build and Release / build-and-release (push) Successful in 1m10s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m10s
Agent changes: - Changed debug!() to info!() for Docker collection logs - This allows logs to show with default RUST_LOG=info setting - Added info import to tracing use statement Now logs will be visible in journalctl without needing to change log level: - "Collecting Docker sub-services for service: docker" - "Found X Docker containers" - "Found X Docker images" - "Total Docker sub-services added: X" Updated to version 0.1.176
This commit is contained in:
parent
f23a1b5cec
commit
eaa057b284
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.175"
|
version = "0.1.176"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -4,7 +4,7 @@ use cm_dashboard_shared::{AgentData, ServiceData, SubServiceData, SubServiceMetr
|
|||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
use std::sync::RwLock;
|
use std::sync::RwLock;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
use tracing::debug;
|
use tracing::{debug, info};
|
||||||
|
|
||||||
use super::{Collector, CollectorError};
|
use super::{Collector, CollectorError};
|
||||||
use crate::config::SystemdConfig;
|
use crate::config::SystemdConfig;
|
||||||
@ -118,10 +118,10 @@ impl SystemdCollector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if service_name.contains("docker") && active_status == "active" {
|
if service_name.contains("docker") && active_status == "active" {
|
||||||
debug!("Collecting Docker sub-services for service: {}", service_name);
|
info!("Collecting Docker sub-services for service: {}", service_name);
|
||||||
|
|
||||||
let docker_containers = self.get_docker_containers();
|
let docker_containers = self.get_docker_containers();
|
||||||
debug!("Found {} Docker containers", docker_containers.len());
|
info!("Found {} Docker containers", docker_containers.len());
|
||||||
for (container_name, container_status) in docker_containers {
|
for (container_name, container_status) in docker_containers {
|
||||||
// For now, docker containers have no additional metrics
|
// For now, docker containers have no additional metrics
|
||||||
// Future: could add memory_mb, cpu_percent, restart_count, etc.
|
// Future: could add memory_mb, cpu_percent, restart_count, etc.
|
||||||
@ -136,7 +136,7 @@ impl SystemdCollector {
|
|||||||
|
|
||||||
// Add Docker images
|
// Add Docker images
|
||||||
let docker_images = self.get_docker_images();
|
let docker_images = self.get_docker_images();
|
||||||
debug!("Found {} Docker images", docker_images.len());
|
info!("Found {} Docker images", docker_images.len());
|
||||||
for (image_name, image_status, image_size) in docker_images {
|
for (image_name, image_status, image_size) in docker_images {
|
||||||
let mut metrics = Vec::new();
|
let mut metrics = Vec::new();
|
||||||
metrics.push(SubServiceMetric {
|
metrics.push(SubServiceMetric {
|
||||||
@ -152,7 +152,7 @@ impl SystemdCollector {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!("Total Docker sub-services added: {}", sub_services.len());
|
info!("Total Docker sub-services added: {}", sub_services.len());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create complete service data
|
// Create complete service data
|
||||||
@ -824,7 +824,7 @@ impl SystemdCollector {
|
|||||||
fn get_docker_images(&self) -> Vec<(String, String, String)> {
|
fn get_docker_images(&self) -> Vec<(String, String, String)> {
|
||||||
let mut images = Vec::new();
|
let mut images = Vec::new();
|
||||||
|
|
||||||
debug!("Collecting Docker images");
|
info!("Collecting Docker images");
|
||||||
|
|
||||||
// Check if docker is available (use sudo for permissions)
|
// Check if docker is available (use sudo for permissions)
|
||||||
let output = Command::new("sudo")
|
let output = Command::new("sudo")
|
||||||
@ -834,11 +834,11 @@ impl SystemdCollector {
|
|||||||
let output = match output {
|
let output = match output {
|
||||||
Ok(out) if out.status.success() => out,
|
Ok(out) if out.status.success() => out,
|
||||||
Ok(out) => {
|
Ok(out) => {
|
||||||
debug!("Docker images command failed with status: {}", out.status);
|
info!("Docker images command failed with status: {}", out.status);
|
||||||
return images;
|
return images;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
debug!("Docker images command error: {}", e);
|
info!("Docker images command error: {}", e);
|
||||||
return images;
|
return images;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.175"
|
version = "0.1.176"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.175"
|
version = "0.1.176"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user