Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Fix missing impact text and incomplete alert type coverage in unified findings

rcourtman63d7640a0659
diff --git a/internal/ai/unified/alerts.go b/internal/ai/unified/alerts.go
index f8efb62cbb..22c4ef28a0 100644
--- a/internal/ai/unified/alerts.go
+++ b/internal/ai/unified/alerts.go
@@ -331,29 +331,50 @@ func DefaultAlertToFindingConfig() AlertToFindingConfig {
return AlertToFindingConfig{
DefaultCategory: CategoryPerformance,
TypeCategoryMap: map[string]UnifiedCategory{
- "cpu": CategoryPerformance,
- "memory": CategoryPerformance,
- "disk": CategoryCapacity,
- "diskRead": CategoryPerformance,
- "diskWrite": CategoryPerformance,
- "networkIn": CategoryPerformance,
- "networkOut": CategoryPerformance,
- "usage": CategoryCapacity,
- "storage": CategoryCapacity,
- "temperature": CategoryReliability,
- "diskTemperature": CategoryReliability,
- "offline": CategoryConnectivity,
- "nodeOffline": CategoryConnectivity,
- "poweredOff": CategoryReliability,
- "backup": CategoryBackup,
- "backupMissing": CategoryBackup,
- "backupStale": CategoryBackup,
- "snapshot": CategoryBackup,
- "snapshotAge": CategoryBackup,
- "snapshotSize": CategoryCapacity,
- "restartLoop": CategoryReliability,
- "oom": CategoryReliability,
- "imageUpdateAvail": CategoryConfiguration,
+ "cpu": CategoryPerformance,
+ "memory": CategoryPerformance,
+ "disk": CategoryCapacity,
+ "diskRead": CategoryPerformance,
+ "diskWrite": CategoryPerformance,
+ "networkIn": CategoryPerformance,
+ "networkOut": CategoryPerformance,
+ "usage": CategoryCapacity,
+ "storage": CategoryCapacity,
+ "temperature": CategoryReliability,
+ "diskTemperature": CategoryReliability,
+ "offline": CategoryConnectivity,
+ "nodeOffline": CategoryConnectivity,
+ "host-offline": CategoryConnectivity,
+ "docker-host-offline": CategoryConnectivity,
+ "connectivity": CategoryConnectivity,
+ "poweredOff": CategoryReliability,
+ "powered-off": CategoryReliability,
+ "backup": CategoryBackup,
+ "backupMissing": CategoryBackup,
+ "backupStale": CategoryBackup,
+ "backup-age": CategoryBackup,
+ "snapshot": CategoryBackup,
+ "snapshotAge": CategoryBackup,
+ "snapshot-age": CategoryBackup,
+ "snapshotSize": CategoryCapacity,
+ "restartLoop": CategoryReliability,
+ "oom": CategoryReliability,
+ "imageUpdateAvail": CategoryConfiguration,
+ "docker-container-update": CategoryConfiguration,
+ "zfs-pool-state": CategoryReliability,
+ "zfs-pool-errors": CategoryReliability,
+ "zfs-device": CategoryReliability,
+ "storage-topology": CategoryCapacity,
+ "disk-health": CategoryReliability,
+ "disk-wearout": CategoryReliability,
+ "raid": CategoryReliability,
+ "docker-container-health": CategoryReliability,
+ "docker-container-memory-limit": CategoryReliability,
+ "docker-container-oom-kill": CategoryReliability,
+ "docker-container-restart-loop": CategoryReliability,
+ "docker-container-state": CategoryReliability,
+ "docker-service-health": CategoryReliability,
+ "message-age": CategoryReliability,
},
}
}
@@ -1270,18 +1291,48 @@ func generateImpact(alertType string) string {
switch alertType {
case "cpu":
return "Workloads on this resource slow down or queue requests; sustained pressure can stall services and propagate latency to dependent workloads."
- case "memory":
+ case "memory", "docker-container-memory-limit":
return "Memory pressure can trigger OOM kills or swap thrashing, terminating processes or stalling the host until pressure clears."
case "disk":
return "Writes will start failing when the disk fills, which can corrupt running workloads and stop logging, monitoring, and backup jobs."
+ case "diskRead", "diskWrite":
+ return "Sustained I/O pressure causes workloads to queue and stall, propagating latency to dependent services."
+ case "networkIn", "networkOut":
+ return "Network saturation causes packet loss and latency, slowing or timing out dependent connections."
case "usage", "storage":
return "Storage writes will start failing when capacity is exhausted, blocking new data, snapshots, and backup retention."
- case "temperature":
+ case "temperature", "diskTemperature":
return "Sustained heat throttles performance and shortens hardware life; in critical ranges the system can shut down or fail unexpectedly."
- case "offline", "nodeOffline":
+ case "offline", "nodeOffline", "host-offline", "docker-host-offline", "connectivity":
return "Workloads on this resource are unreachable; backups, scheduled jobs, and dependent services on this host stop until it returns."
- case "poweredOff":
+ case "poweredOff", "powered-off":
return "Nothing on this resource is running, so any workload, backup, or dependent service it provides is unavailable."
+ case "zfs-pool-state", "zfs-pool-errors":
+ return "Pool errors indicate data integrity risk; uncorrected errors can lead to silent data corruption or total pool failure."
+ case "zfs-device":
+ return "A faulted or degraded device risks pool failure; if redundancy is already lost, data on this pool is at risk."
+ case "storage-topology":
+ return "Misconfigured storage topology can cause unexpected capacity exhaustion, unbalanced wear, or lost redundancy."
+ case "disk-health", "disk-wearout":
+ return "Failing or worn disks risk data loss; if the disk fails before replacement, data on it may be unrecoverable."
+ case "raid":
+ return "A degraded RAID array has reduced or no redundancy; a second disk failure before rebuild completes can cause permanent data loss."
+ case "backup", "backupMissing", "backupStale", "backup-age":
+ return "Without recent backups, data lost to failure or corruption cannot be recovered to a known-good state."
+ case "snapshot", "snapshotAge", "snapshot-age":
+ return "Old snapshots lose restore value as they drift further from current data; recovery points become stale."
+ case "snapshotSize":
+ return "Large snapshots consume pool capacity and can block new writes when space is exhausted."
+ case "oom", "docker-container-oom-kill":
+ return "Out-of-memory kills terminate processes without warning, causing data loss or service disruption."
+ case "restartLoop", "docker-container-restart-loop":
+ return "A restart loop means the workload cannot reach a stable state; dependent services cycle in and out of availability."
+ case "imageUpdateAvail", "docker-container-update":
+ return "Pending updates may include security patches; unpatched images accumulate known vulnerabilities over time."
+ case "docker-container-health", "docker-service-health", "docker-container-state":
+ return "An unhealthy container or service cannot serve its function; dependent workloads may fail or degrade."
+ case "message-age":
+ return "Stale monitoring data means current status is unknown; issues may have developed without detection."
default:
return ""
}
diff --git a/internal/ai/unified/alerts_test.go b/internal/ai/unified/alerts_test.go
index 56be5dfe99..5a7b4ea0f3 100644
--- a/internal/ai/unified/alerts_test.go
+++ b/internal/ai/unified/alerts_test.go
@@ -76,7 +76,36 @@ func TestGenerateImpact_AuthorsConsequenceForKnownAlertTypes(t *testing.T) {
{"temperature", "throttles"},
{"offline", "unreachable"},
{"nodeOffline", "unreachable"},
+ {"host-offline", "unreachable"},
+ {"docker-host-offline", "unreachable"},
+ {"connectivity", "unreachable"},
{"poweredOff", "unavailable"},
+ {"powered-off", "unavailable"},
+ {"zfs-pool-state", "data integrity"},
+ {"zfs-pool-errors", "data integrity"},
+ {"zfs-device", "pool failure"},
+ {"storage-topology", "capacity"},
+ {"disk-health", "data loss"},
+ {"disk-wearout", "data loss"},
+ {"raid", "redundancy"},
+ {"diskRead", "queue"},
+ {"diskWrite", "queue"},
+ {"networkIn", "latency"},
+ {"networkOut", "latency"},
+ {"backup-age", "cannot be recovered"},
+ {"snapshot-age", "stale"},
+ {"snapshotSize", "capacity"},
+ {"oom", "terminate"},
+ {"docker-container-oom-kill", "terminate"},
+ {"restartLoop", "stable state"},
+ {"docker-container-restart-loop", "stable state"},
+ {"imageUpdateAvail", "vulnerabilities"},
+ {"docker-container-update", "vulnerabilities"},
+ {"docker-container-health", "cannot serve"},
+ {"docker-service-health", "cannot serve"},
+ {"docker-container-state", "cannot serve"},
+ {"docker-container-memory-limit", "OOM"},
+ {"message-age", "unknown"},
}
for _, tc := range cases {
t.Run(tc.alertType, func(t *testing.T) {
diff --git a/internal/api/ai_intelligence_handlers.go b/internal/api/ai_intelligence_handlers.go
index 47e5bb2e93..84311f1225 100644
--- a/internal/api/ai_intelligence_handlers.go
+++ b/internal/api/ai_intelligence_handlers.go
@@ -1142,6 +1142,7 @@ func (h *AISettingsHandler) HandleGetUnifiedFindings(w http.ResponseWriter, r *h
Node string `json:"node,omitempty"`
Title string `json:"title"`
Description string `json:"description"`
+ Impact string `json:"impact,omitempty"`
Recommendation string `json:"recommendation,omitempty"`
Evidence string `json:"evidence,omitempty"`
AlertIdentifier string `json:"alert_identifier,omitempty"`
@@ -1229,6 +1230,7 @@ func (h *AISettingsHandler) HandleGetUnifiedFindings(w http.ResponseWriter, r *h
Node: f.Node,
Title: f.Title,
Description: f.Description,
+ Impact: f.Impact,
Recommendation: f.Recommendation,
Evidence: f.Evidence,
AlertIdentifier: f.AlertIdentifier,
diff --git a/internal/api/ai_intelligence_handlers_more_test.go b/internal/api/ai_intelligence_handlers_more_test.go
index aed132d40d..8cf6be62bd 100644
--- a/internal/api/ai_intelligence_handlers_more_test.go
+++ b/internal/api/ai_intelligence_handlers_more_test.go
@@ -212,6 +212,7 @@ func TestHandleGetUnifiedFindings_WithStore(t *testing.T) {
ResourceType: "vm",
Title: "CPU high",
Description: "cpu usage high",
+ Impact: "Workloads on this resource slow down or queue requests.",
AlertIdentifier: "instance:node:100::metric/cpu",
InvestigationRecord: &aicontracts.InvestigationRecord{
ID: "investigation-1",
@@ -264,6 +265,9 @@ func TestHandleGetUnifiedFindings_WithStore(t *testing.T) {
if _, ok := finding["correlated_ids"]; !ok {
t.Fatalf("expected correlated_ids to be present, got %#v", finding)
}
+ if finding["impact"] != "Workloads on this resource slow down or queue requests." {
+ t.Fatalf("expected impact in response, got %#v", finding["impact"])
+ }
if _, ok := finding["lifecycle"]; !ok {
t.Fatalf("expected lifecycle to be present, got %#v", finding)
}