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(alerts): keep normalized offline capacity suppressed

pulse-triage[bot]9a8ee6a5a7a8
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index 1549f436ab..8eb13ba3ce 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -1394,6 +1394,8 @@ Storage connectivity status is trimmed and case-normalised before evaluation.
Empty or `unknown` status is absent connectivity evidence: it must not advance
recovery or replace an existing incident's identity/start time. Capacity and
pool-health evaluation remain independent and may still use valid observations.
+Normalised `offline` and `unavailable` observations do not feed capacity
+evaluation, preserving the existing rule that offline capacity is not actionable.
The existing non-failing treatment of available, online, active, inactive and
disabled statuses remains unchanged; explicit connectivity-disable policy still
clears the incident. `TestStorageUnknownConnectivityDoesNotRecover` and
diff --git a/internal/alerts/alerts_test.go b/internal/alerts/alerts_test.go
index 8e1bc091e2..1763c3f954 100644
--- a/internal/alerts/alerts_test.go
+++ b/internal/alerts/alerts_test.go
@@ -21096,3 +21096,25 @@ func TestStorageKnownConnectivityRecoveryCompatibility(t *testing.T) {
})
}
}
+
+func TestStorageNormalizedOfflineSkipsCapacityEvaluation(t *testing.T) {
+ for _, status := range []string{" OFFLINE ", " UnAvAiLaBlE "} {
+ t.Run(status, func(t *testing.T) {
+ m := newTestManager(t)
+ disableTestTimeThresholds(m)
+ m.mu.Lock()
+ m.config.StorageDefault = HysteresisThreshold{Trigger: 80, Clear: 70}
+ m.mu.Unlock()
+
+ s := models.Storage{ID: "storage-normalized-offline", Name: "backups", Status: status, Usage: 99}
+ for range 3 {
+ m.CheckStorage(s)
+ }
+
+ testRequireActiveAlert(t, m, canonicalConnectivityStateID(s.ID))
+ if testHasActiveAlert(t, m, canonicalMetricStateID(s.ID, "usage")) {
+ t.Fatal("offline storage produced a capacity alert")
+ }
+ })
+ }
+}
diff --git a/internal/alerts/storage.go b/internal/alerts/storage.go
index 29ef3bf09e..ccbf35a0f2 100644
--- a/internal/alerts/storage.go
+++ b/internal/alerts/storage.go
@@ -108,7 +108,7 @@ func (m *Manager) CheckStorageWithCapacityTrend(storage models.Storage, trend Ca
// confirm an empty store. A default zero from missing capacity telemetry
// must not resolve an existing incident.
confirmedEmpty := storage.Usage == 0 && storage.Total > 0 && storage.Used == 0 && storage.Free == storage.Total
- if storage.Status != "offline" && storage.Status != "unavailable" && (storage.Usage > 0 || confirmedEmpty) {
+ if connectivityStatus != "offline" && connectivityStatus != "unavailable" && (storage.Usage > 0 || confirmedEmpty) {
m.evaluateStorageCapacity(storage, thresholds, trend)
}