feat: Alertmanager as a source for monitors #98

Merged
Sebi merged 3 commits from feat/alertmanager into main 2026-11-22 17:41:25 +00:00
Owner
  • Receivers (Settings → Alertmanager, org.manage): webhook URL /am/uam_… shown once, token stored hashed; Alertmanager can also send it as Authorization: Bearer to /am. Example alertmanager.yml on the page. Rate-limited, 4 MiB body limit.
  • Alerts are upserted by fingerprint (alertmanager_alerts, RLS per organization); resolved and silent ones are purged after 31 days.
  • Monitor type alertmanager: label matchers with Prometheus semantics (= != =~ !~, anchored regex, missing label = empty), stale period (default 24 h, above Alertmanager's repeat_interval). Down while a matching alert fires; message names the alerts with their summary.
  • Evaluation: on each webhook for monitors whose state changed, and once per interval from the heartbeat loop (Redis lock), through recordPassive → usual evaluator, so confirmations, maintenance windows, notifications and SLA work as for any monitor. Pseudo-region "Alertmanager".
  • Overview: firing alerts with the monitors they hold down; "Create monitor" for unfollowed alerts opens the editor prefilled with alertname and identifying labels.
  • Editor: matcher rows and stale period; target, regions and timeout hidden as for heartbeats. API documented, audited.
  • Tested end to end: firing → incident, resolved via bearer → resolved, stale alert ends, other organizations isolated, prefill.

Closes #91

🤖 Generated with Claude Code

https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3

- **Receivers** (Settings → Alertmanager, org.manage): webhook URL `/am/uam_…` shown once, token stored hashed; Alertmanager can also send it as `Authorization: Bearer` to `/am`. Example alertmanager.yml on the page. Rate-limited, 4 MiB body limit. - **Alerts** are upserted by fingerprint (`alertmanager_alerts`, RLS per organization); resolved and silent ones are purged after 31 days. - **Monitor type `alertmanager`**: label matchers with Prometheus semantics (`= != =~ !~`, anchored regex, missing label = empty), stale period (default 24 h, above Alertmanager's repeat_interval). Down while a matching alert fires; message names the alerts with their summary. - **Evaluation:** on each webhook for monitors whose state changed, and once per interval from the heartbeat loop (Redis lock), through `recordPassive` → usual evaluator, so confirmations, maintenance windows, notifications and SLA work as for any monitor. Pseudo-region "Alertmanager". - **Overview:** firing alerts with the monitors they hold down; "Create monitor" for unfollowed alerts opens the editor prefilled with alertname and identifying labels. - Editor: matcher rows and stale period; target, regions and timeout hidden as for heartbeats. API documented, audited. - Tested end to end: firing → incident, resolved via bearer → resolved, stale alert ends, other organizations isolated, prefill. Closes #91 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi added this to the M11 Uptime Kuma parity milestone 2026-11-22 15:00:10 +00:00
Sebi added 3 commits 2026-11-22 15:00:12 +00:00
Refs #91

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Refs #91

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
feat: Alertmanager as a source for monitors
ci / image (pull_request) Successful in 2m59s
ci / build (pull_request) Successful in 4m9s
ci / lint (pull_request) Successful in 8m8s
ci / test (pull_request) Successful in 8m32s
b3e34613a3
Organizations create receiver URLs for Alertmanager's webhook (token in
the path or as bearer). A monitor of type alertmanager is down while an
alert matching all its label matchers fires, and goes through the usual
evaluation, so confirmations, maintenance, notifications and SLA apply.
Results are recorded when the state changes and once per interval;
alerts Alertmanager stops repeating end after the monitor's stale period,
so a lost resolve cannot hold it down. An overview lists firing alerts
with the monitors following them and creates a prefilled monitor for the
others.

Closes #91

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi merged commit 37d49e0033 into main 2026-11-22 17:41:24 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ZB-Server/uptimesebi#98