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.

feat(alerts): record fired events for reconciler and system alerts

rcourtmanfbbdb929dc6b
diff --git a/internal/alerts/system_alert.go b/internal/alerts/system_alert.go
index 79d7654d7c..fc9b40e141 100644
--- a/internal/alerts/system_alert.go
+++ b/internal/alerts/system_alert.go
@@ -1,6 +1,7 @@
package alerts
import (
+ "github.com/rcourtman/pulse-go-rewrite/internal/alerts/eventlog"
"strings"
"time"
@@ -146,6 +147,7 @@ func (m *Manager) RaiseSystemAlert(input SystemAlertInput) bool {
if m.historyManager != nil {
m.historyManager.AddAlert(*alert)
}
+ m.recordAlertEvent(eventlog.TypeFired, alert, alertID, "system-alert", input.Message, nil)
m.dispatchAlert(alert, true)
m.mu.Unlock()
diff --git a/internal/alerts/unified_incidents.go b/internal/alerts/unified_incidents.go
index ac97f28881..466ea84d6c 100644
--- a/internal/alerts/unified_incidents.go
+++ b/internal/alerts/unified_incidents.go
@@ -4,6 +4,7 @@ import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
+ "github.com/rcourtman/pulse-go-rewrite/internal/alerts/eventlog"
"strconv"
"strings"
"time"
@@ -267,6 +268,7 @@ func (m *Manager) SyncUnifiedResourceIncidents(resources []unifiedresources.Reso
m.setActiveAlertNoLock(storageKey, alert)
m.recentAlerts[canonicalTrackingKeyForAlert(alert)] = alert
m.historyManager.AddAlert(*alert)
+ m.recordAlertEvent(eventlog.TypeFired, alert, storageKey, "unified-incident", alert.Message, nil)
m.dispatchAlert(alert, false)
}
}