Repository navigation
Description
Split from #4714.
Problem or Motivation. The project review must report a critical alert or NodeNotReady as an incident trigger, and the SRE guideline says an alert that an active silence matches is not a trigger: the alert state comes from the Alertmanager API, and the ALERTS series of Prometheus does not know the silences (docs/guidelines/sre.md:93). Change 4692 left the match of a silence to an alert to #4714 (openspec/changes/archive/2026-11-21-4692-read-project-review-facts-through-a-catalog/design.md:10). The review already reads the firing series-hours of each alert (prometheus.alerts_firing_hours, catalog.yaml:448) and the count of active silences (prometheus.silences_active, catalog.yaml:483), but it cannot match a silence to an alert, so a silenced critical alert would add an incident section.
Why this part is deferred. The stage job stopped #4714: the task group Add the Alertmanager address and the incident trigger settings held 67339 tokens, over the 64000-token budget of a step, also after the model split the groups once, and the recommendation is to split the group. The Alertmanager address is a setting with no default, because a fallback address is not allowed (openspec/changes/archive/2026-11-21-4692-read-project-review-facts-through-a-catalog/design.md:131), so only a person sets it. This part holds the Alertmanager client, the silence match and the critical-alert trigger.
Acceptance Criteria.
- A fake Alertmanager response with an active silence that matches a firing alert gives that silence in the alert fact, and the alert adds no incident section.
- A critical alert or NodeNotReady that fires for 30 minutes or more with no matching silence adds the incident section, and its timeline starts at the first firing sample.
- The address comes from the setting
alertmanager.urlwith no default. An unset setting gives a fact with the reason of the missing value, never the value 0. - The request names no host name, and
data.jsongives the source of the fact. uv run pytest tests/roadmap/project_reviewpasses.
Proposed design
Problem statement
The project review reports a critical alert or NodeNotReady as an incident trigger. The SRE guideline says an alert that an active silence matches is not a trigger. The review reads alert state from Prometheus ALERTS, and that series does not know silences. The review must read alert state and silence matches from the Alertmanager API. It must add an incident section only for an unsilenced critical alert or NodeNotReady that fires for 30 minutes or more. The timeline must start at the first firing sample.
Acceptance criteria
Requirement: Alertmanager alert fact keeps active silences
The project review SHALL read alert state from the Alertmanager v2 alerts endpoint and SHALL keep each alert's active silence IDs in the alert fact.
Scenario: An active silence matches a firing alert
- WHEN A fake Alertmanager response holds one firing critical alert with
status.silencedByset to one active silence ID. - THEN The alert fact holds that silence ID and the review adds no incident section.
Requirement: Critical alert starts an incident
The project review SHALL add an incident section for a critical alert that fires for 30 minutes or more and has no active silence.
Scenario: An unsilenced critical alert fires for 30 minutes
- WHEN A fake Alertmanager response and a fake Prometheus response hold a critical alert with no
silencedByentry and a first firing sample 30 minutes before the review time. - THEN The review adds the incident section and the timeline starts at the first firing sample.
Requirement: NodeNotReady starts an incident
The project review SHALL add an incident section for a NodeNotReady alert that fires for 30 minutes or more and has no active silence, even when its severity is not critical.
Scenario: An unsilenced NodeNotReady alert fires for 30 minutes
- WHEN A fake Alertmanager response and a fake Prometheus response hold a NodeNotReady alert with no
silencedByentry and a first firing sample 30 minutes before the review time. - THEN The review adds the incident section and the timeline starts at the first firing sample.
Requirement: Alertmanager URL has no default
The project review SHALL read the Alertmanager address from the setting alertmanager.url and MUST use no default value.
Scenario: The setting is unset
- WHEN The setting
alertmanager.urlis unset and the review reads the Alertmanager fact. - THEN The fact holds the reason that the setting is missing and never the value 0.
Requirement: Alertmanager request uses the configured URL
The Alertmanager reader MUST build its request from the setting alertmanager.url and MUST NOT contain a hard-coded host name.
Scenario: A test URL is configured
- WHEN The setting
alertmanager.urlishttps://alertmanager.example.comand the reader runs against a fake HTTP transport. - THEN The request URL is
https://alertmanager.example.com/api/v2/alertsand the reader source holds no hard-coded host name.
Requirement: Data file records the fact source
The project review SHALL write the setting name alertmanager.url as the source of the Alertmanager fact in data.json.
Scenario: The review writes data.json
- WHEN The review writes
data.jsonafter it reads the fake Alertmanager response. - THEN
data.jsonholdsalertmanager.urlas the source and holds no host name.
Requirement: Project review tests pass
The project review test suite SHALL pass with the new Alertmanager and incident behavior.
Scenario: Run the project review tests
- WHEN A developer runs
uv run pytest tests/roadmap/project_review. - THEN The command exits 0 and reports no failed test.
Requirement: Pending a person after the merge
A person MUST set the alertmanager.url setting to the live Alertmanager address after the merge.
Scenario: The live Alertmanager address is configured
- WHEN A person sets
alertmanager.urlto the live Alertmanager address after the merge. - THEN The next project review run reads the Alertmanager API and adds no missing-value fact.
Existing Tool Considered
No alternatives check has run. The open, maintained Alertmanager v2 HTTP API covers the need: GET /api/v2/alerts returns each alert with status.silencedBy, so Alertmanager performs the silence match. The plan adds only a thin reader, the 30-minute trigger and the timeline join. That reader costs about 4k-8k tokens and 0.5-1 day to build, keep and fix. A custom silence matcher would cost about 10k-20k tokens and 1-2 days.
Key questions
- Which source gives the alert state and the active silence match?: The review uses
GET /api/v2/alertson the Alertmanager API. Each alert carriesstatus.silencedBy. The review maps that list into the alert fact and does not run its own silence matcher. (best practice) [sources: docs/guidelines/sre.md:93, openspec/changes/archive/2026-11-21-4692-read-project-review-facts-through-a-catalog/design.md:10]- Chosen: Alertmanager
/api/v2/alertsstatus.silencedBy. Alertmanager applies silences to each alert, and the SRE guideline names the Alertmanager API as the source of alert state. - Rejected: Custom matcher over
/api/v2/silences. It repeats Alertmanager matching logic and adds code, tests and failure modes. - Rejected: Prometheus
ALERTSseries. The SRE guideline states thatALERTSdoes not know the silences.
- Chosen: Alertmanager
- Does
alertmanager.urlhave a default value?: No. The setting has no default. An unset value gives a fact with a missing-value reason, not the value 0. [sources: openspec/changes/archive/2026-11-21-4692-read-project-review-facts-through-a-catalog/design.md:131] - Which existing project review facts does this change extend?: The catalog already holds
prometheus.alerts_firing_hoursandprometheus.silences_active. The new Alertmanager fact adds the per-alert silence IDs and the incident trigger. [sources: src/devops_cli/roadmap/project_review/catalog.yaml:448, src/devops_cli/roadmap/project_review/catalog.yaml:483]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 26, 2026
project-review, and .github/labels.yml declares no scope/project-review label. Add the label to the file to give the scope to this item.Both split from #4714 and serve the SRE incident-trigger guideline, but 5477 adds jobs that read SLOs while this adds silence matching to the project review.[-]feat(project-review): match active silences to alerts and trigger on a critical alert[/-][+]feat(project-review): match silences to alerts and trigger on critical alert[/+]devops-cli-service commentedon Nov 26, 2026
The job shortened the title of this item. The summary had 63 characters, and the limit is 60. The type and the scope stay.
feat(project-review): match active silences to alerts and trigger on a critical alertdevops-cli-service commentedon Nov 28, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.