Improve notification behavior during startup and recovery
All checks were successful
Build and Release / build-and-release (push) Successful in 2m9s
All checks were successful
Build and Release / build-and-release (push) Successful in 2m9s
Fix notification issues for better operational experience: Startup Notification Suppression: - Suppress notifications for transitions from Status::Unknown during agent/server startup - Prevents notification spam when services transition from Unknown to Warning/Critical on restart - Only real status changes (not initial discovery) trigger notifications - Maintains alerting for actual service state changes after startup Recovery Notification Refinement: - Recovery notifications only sent when ALL services reach OK status - Individual service recoveries suppressed if other services still have problems - Ensures recovery notifications indicate complete system health restoration - Prevents premature celebration when partial recoveries occur Result: Clean startup experience without false alerts and meaningful recovery notifications that truly indicate full system health restoration. Bump version to v0.1.48
This commit is contained in:
parent
bd20f0cae1
commit
4f4c3b0d6e
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -270,7 +270,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.46"
|
version = "0.1.47"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
@ -291,7 +291,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.46"
|
version = "0.1.47"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
@ -314,7 +314,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.46"
|
version = "0.1.47"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"serde",
|
"serde",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-agent"
|
name = "cm-dashboard-agent"
|
||||||
version = "0.1.47"
|
version = "0.1.48"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -272,11 +272,13 @@ impl HostStatusManager {
|
|||||||
/// Check if a status change is significant enough for notification
|
/// Check if a status change is significant enough for notification
|
||||||
fn is_significant_change(&self, old_status: Status, new_status: Status) -> bool {
|
fn is_significant_change(&self, old_status: Status, new_status: Status) -> bool {
|
||||||
match (old_status, new_status) {
|
match (old_status, new_status) {
|
||||||
// Always notify on problems
|
// Don't notify on transitions from Unknown (startup/restart scenario)
|
||||||
|
(Status::Unknown, _) => false,
|
||||||
|
// Always notify on problems (but not from Unknown)
|
||||||
(_, Status::Warning) | (_, Status::Critical) => true,
|
(_, Status::Warning) | (_, Status::Critical) => true,
|
||||||
// Only notify on recovery if it's from a problem state to OK and all services are OK
|
// Only notify on recovery if it's from a problem state to OK and all services are OK
|
||||||
(Status::Warning | Status::Critical, Status::Ok) => self.current_host_status == Status::Ok,
|
(Status::Warning | Status::Critical, Status::Ok) => self.current_host_status == Status::Ok,
|
||||||
// Don't notify on startup or other transitions
|
// Don't notify on other transitions
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -374,8 +376,8 @@ impl HostStatusManager {
|
|||||||
details.push('\n');
|
details.push('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show recoveries
|
// Show recoveries only if host status is now OK (all services recovered)
|
||||||
if !recovery_changes.is_empty() {
|
if !recovery_changes.is_empty() && aggregated.host_status_final == Status::Ok {
|
||||||
details.push_str(&format!("✅ RECOVERIES ({}):\n", recovery_changes.len()));
|
details.push_str(&format!("✅ RECOVERIES ({}):\n", recovery_changes.len()));
|
||||||
for change in recovery_changes {
|
for change in recovery_changes {
|
||||||
details.push_str(&format!(" {}\n", change));
|
details.push_str(&format!(" {}\n", change));
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard"
|
name = "cm-dashboard"
|
||||||
version = "0.1.47"
|
version = "0.1.48"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cm-dashboard-shared"
|
name = "cm-dashboard-shared"
|
||||||
version = "0.1.47"
|
version = "0.1.48"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user