Add exclude_email_metrics configuration option
All checks were successful
Build and Release / build-and-release (push) Successful in 2m34s
All checks were successful
Build and Release / build-and-release (push) Successful in 2m34s
- Add exclude_email_metrics field to AgentConfig for filtering email notifications - Metrics matching excluded names skip notification processing but still appear in dashboard - Optional field with serde(default) for backward compatibility - Bump version to 0.1.56
This commit is contained in:
parent
2d080a2f51
commit
0e7cf24dbb
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.55"
|
version = "0.1.56"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -201,6 +201,12 @@ impl Agent {
|
|||||||
async fn process_metrics(&mut self, metrics: &[Metric]) -> bool {
|
async fn process_metrics(&mut self, metrics: &[Metric]) -> bool {
|
||||||
let mut status_changed = false;
|
let mut status_changed = false;
|
||||||
for metric in metrics {
|
for metric in metrics {
|
||||||
|
// Filter excluded metrics from email notification processing only
|
||||||
|
if self.config.exclude_email_metrics.contains(&metric.name) {
|
||||||
|
debug!("Excluding metric '{}' from email notification processing", metric.name);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if self.host_status_manager.process_metric(metric, &mut self.notification_manager).await {
|
if self.host_status_manager.process_metric(metric, &mut self.notification_manager).await {
|
||||||
status_changed = true;
|
status_changed = true;
|
||||||
}
|
}
|
||||||
@ -226,6 +232,7 @@ impl Agent {
|
|||||||
format!("v{}", env!("CARGO_PKG_VERSION"))
|
format!("v{}", env!("CARGO_PKG_VERSION"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async fn handle_commands(&mut self) -> Result<()> {
|
async fn handle_commands(&mut self) -> Result<()> {
|
||||||
// Try to receive commands (non-blocking)
|
// Try to receive commands (non-blocking)
|
||||||
match self.zmq_handler.try_receive_command() {
|
match self.zmq_handler.try_receive_command() {
|
||||||
|
|||||||
@ -17,6 +17,9 @@ pub struct AgentConfig {
|
|||||||
pub notifications: NotificationConfig,
|
pub notifications: NotificationConfig,
|
||||||
pub status_aggregation: HostStatusConfig,
|
pub status_aggregation: HostStatusConfig,
|
||||||
pub collection_interval_seconds: u64,
|
pub collection_interval_seconds: u64,
|
||||||
|
/// List of metric names to exclude from email notifications
|
||||||
|
#[serde(default)]
|
||||||
|
pub exclude_email_metrics: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// ZMQ communication configuration
|
/// ZMQ communication configuration
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.55"
|
version = "0.1.56"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.55"
|
version = "0.1.56"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user