feat: multi-region evaluation, incidents and notifications (M5) #51

Merged
Sebi merged 4 commits from feat/m5-alerting into main 2026-11-22 00:46:20 +00:00
4 Commits
Author SHA1 Message Date
Sebastian UnterschützandClaude Opus 5.5 5f42e3e650 feat(api): open incidents and notify channels when monitors go down
Results are evaluated as they arrive. Transitions open or resolve the
monitor's incident and queue a notification per enabled channel in the
same transaction; every API replica delivers the outbox with leases and
exponential retries. Organizations manage webhook and email channels,
can send test notifications and list incidents. Email requires
UPTIME_SMTP_URL.

Closes #14
Closes #15
Closes #16

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
2026-11-22 01:23:37 +01:00
Sebastian UnterschützandClaude Opus 5.5 01ef543e62 feat(notify): deliver incidents by signed webhook and smtp
Webhooks carry an HMAC-SHA256 signature over timestamp and body and
refuse private addresses unless allowed.

Refs #16

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
2026-11-22 01:23:37 +01:00
Sebastian UnterschützandClaude Opus 5.5 de7c6fc842 feat(evaluate): alert only when every region of a monitor fails
Regions without recent results count as unknown and keep the monitor up.
State changes are decided by one Lua script so concurrent results on
several API replicas yield a single transition.

Refs #14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
2026-11-22 01:23:37 +01:00
Sebastian UnterschützandClaude Opus 5.5 ffef63e586 feat(store): add incidents, notification channels and delivery outbox
At most one open incident per monitor is enforced by a partial unique
index.

Refs #15, #16

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
2026-11-22 01:23:37 +01:00