Skip to content

feat(project-review): match silences to alerts and trigger on critical alert #7349

Backlog

Description

@devops-cli-service

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.url with 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.json gives the source of the fact.
  • uv run pytest tests/roadmap/project_review passes.

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.silencedBy set 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 silencedBy entry 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 silencedBy entry 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.url is 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.url is https://alertmanager.example.com and the reader runs against a fake HTTP transport.
  • THEN The request URL is https://alertmanager.example.com/api/v2/alerts and 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.json after it reads the fake Alertmanager response.
  • THEN data.json holds alertmanager.url as 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.url to 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/alerts on the Alertmanager API. Each alert carries status.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/alerts status.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 ALERTS series. The SRE guideline states that ALERTS does not know the silences.
  • Does alertmanager.url have 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_hours and prometheus.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

  1. added
    type/feature
    source/agent
    status/new
    value/medium
    effort/medium
    on Nov 26, 2026
  2. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    ContributorAuthor
    • Scope: none. The title has the scope 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.
    • Related: feat(roadmap): add incident and supervise jobs that read the SLOs #5477, which asks for a different change. 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.
  3. changed the title [-]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[/+] on Nov 26, 2026
  4. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    ContributorAuthor

    The job shortened the title of this item. The summary had 63 characters, and the limit is 60. The type and the scope stay.

    • Before: feat(project-review): match active silences to alerts and trigger on a critical alert
    • Source of the summary: the background model
  5. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumsource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions