feat(alerting): Plan 02 — backend (domain, storage, evaluators, dispatch) #140

Merged
claude merged 53 commits from feat/alerting-02-backend into main 2026-04-20 09:03:16 +02:00
Showing only changes of commit 7e79ff4d98 - Show all commits

View File

@@ -0,0 +1,7 @@
-- V13 — Unique partial index: at most one open alert_instance per rule
-- Prevents duplicate FIRING rows in multi-replica deployments.
-- The Java save() path catches DuplicateKeyException and log-and-skips the losing insert.
CREATE UNIQUE INDEX alert_instances_open_rule_uq
ON alert_instances (rule_id)
WHERE rule_id IS NOT NULL
AND state IN ('PENDING','FIRING','ACKNOWLEDGED');