Skip to content

feat(alerts): silences match an anomaly incident's service and environment - #2319

Merged
Makisuo merged 27 commits into
mainfrom
feat/alerts-incident-labels
Nov 6, 2026
Merged

Makisuo merged 27 commits into
mainfrom
feat/alerts-incident-labels

Merge remote-tracking branch 'origin/main' into feat/alerts-incident-…

6b56451
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review succeeded Nov 6, 2026 in 1m 2s

Confidence 10/10 · No issues found

🟢 Confidence 10/10 · safe to merge. Silence matching gains one optional label source threaded through all five lookup sites, pinned by unit and PGlite integration tests.
no findings · tests covered · risk medium

Anomaly incidents now store the service and environment they are about in a new labels_json column, and the silence matcher consults those labels before the group key and rule scope, so a services: ["checkout"] silence mutes checkout anomalies. Labels are threaded through every silence lookup and exposed on the incident document, v2 wire, web-data and MCP outputs; safe to merge.

  • alert_incidents.labels_json records an incident's service/environment; anomaly incidents set it at open
  • scopedServices/scopedEnvironments prefer target.labels over group key and rule scope
  • findActiveSilence takes labels at open, reminders, catch-up and both auto-resolve paths
  • labels added to the incident document, v2 incident, web-data row decoding and MCP outputs

Before merge

What was checked
  • anomalyIncidentLabels maps empty serviceName/deploymentEnv to absent labels and returns null, so no null-valued jsonb is written (AnomalyAlertSource.ts:257)
  • All five findActiveSilence call sites pass labels in the same argument position (AlertsService.ts:3313,3482,3779,4110,4306)
  • Web-data decodes labels_json leniently with Schema.Unknown, so an unreadable value drops labels, not the incident

6b56451 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.