Description
Update 2026-11-26 (infra move): Alertmanager and the environment alert rules moved to dan-petty/homelab.
This issue keeps the "Do this" step and its test for the product alerts (rules in k8s/devops/monitoring/). The environment alert rows, the route checks and the live page count are in the homelab follow-up. docs/SRE.md is now docs/guidelines/sre.md.
Follow-up: dan-petty/homelab#300.
Problem or Motivation
The SRE service spec (docs/guidelines/sre.md, #5445) sets at most 2 pages a day. A ticket is an issue, or a comment on the open issue of its cause, and it does not notify a person at once. Today Alertmanager sends the critical and the warning alerts to one Mattermost receiver (k8s/README.md, Receiver). So a page does not differ from a ticket.
Measured on 2026-11-13 at 16:20 UTC:
sum(increase(alertmanager_notifications_total{integration="mattermost"}[7d]))is 453: about 65 notifications a day, and 0 failed.sum by (rule_group) (prometheus_rule_group_rules)gives 47 rules in the 12 environment groups.- The alert table of the environment rules in
k8s/README.mdhas the columns Alert, Fires when, For and Severity. It has no "Do this" step. The alert tables ofdocs/CLUSTER.mdhave one. So a ticket from an environment rule cannot tell the reader what to do.
Proposed Solution
- Keep the
criticalroute on the Mattermost alert channel. - Route
warningto a webhook receiver that opens an issue, or comments on the open issue of the same alert and labels. The issue or the comment holds the "Do this" step of the alert row. - Add a "Do this" column to the environment alert table of
k8s/README.md, with one step for each rule. - Add a test that fails when an alert rule has no row with a "Do this" step.
Acceptance Criteria
- A test of the Alertmanager values proves that
criticalgoes to the Mattermost receiver andwarninggoes to the ticket receiver. - Each row of the environment alert table of
k8s/README.mdhas a "Do this" step, and a test fails on a rule with no such row. - Live proof: in the 7 days after the rollout, the alert channel gets 2 pages a day or fewer, and each warning alert has an issue or a comment.
Existing Tool Considered
Alertmanager webhook_configs is the standard receiver interface. First check an open bridge from an Alertmanager webhook to GitHub issues, such as m-lab/alertmanager-github-receiver (Apache-2.0), for its maintenance. If no bridge is maintained, the webhook router of the Roadmap Service takes the Alertmanager payload. Cost to build that route: about 0.4 M tokens and 3 hours.
Related
#4709 (the burn-rate alerts that page), dan-petty/homelab#344, #3655, dan-petty/homelab#356.
Source: #5445
Owner decision 2026-11-13
The owner accepted the design of the roadmap pipeline split (tracker #5482) on 2026-11-13. That design rejects an Alertmanager route that files issues. The incident job of #5477 reads the Alertmanager API and is the one writer of incident issues, so one alert never gets two issues. This changes the scope of this item:
- Alertmanager routes page alerts (
critical) to chat only: the Mattermost alert channel. - A ticket-level alert (
warning) becomes an issue only through the incident job of feat(roadmap): add incident and supervise jobs that read the SLOs #5477 (one writer). This item adds no webhook receiver, no route to issues and no bridge from Alertmanager to GitHub issues. - Removed from the scope: the
warningroute to a webhook receiver, the ticket receiver, the receiver test ofwarning, and the check of a bridge such as m-lab/alertmanager-github-receiver. - Kept in the scope: the "Do this" column of the environment alert table in
k8s/README.md, with one step for each rule, and the test that fails on a rule with no such row. The incident job of feat(roadmap): add incident and supervise jobs that read the SLOs #5477 can then give the step in its issue. - Move
warningoff the chat route only when the incident job of feat(roadmap): add incident and supervise jobs that read the SLOs #5477 runs in modeon, so no warning alert is lost in the gap.warningthen goes to a receiver with no integration, and the incident job reads it from the Alertmanager API.
These criteria replace the first and the third criterion above:
- A test of the Alertmanager values proves that
criticalgoes to the Mattermost receiver and that no route sends an alert to a receiver that files issues. - Live proof: in the 7 days after
warningleaves the chat route, the alert channel gets 2 pages a day or fewer. A comment gives the count.
Alternatives check of 2026-11-23: none.
Tool: none found.
Reason: Searches found only the Alertmanager-to-GitHub issue bridge, which the owner decision rules out; no tool writes a per-alert "Do this" step or tests the alert table against the rule files.
Lacks:
- Per-alert Do this step in the environment alert table
- Test that fails on a rule with no Do this row
- Route change for warning that loses no alert
Proposed design
Problem statement
Alertmanager sends both critical and warning alerts to one Mattermost receiver, so a page and a ticket look the same. The owner decision of 2026-11-13 makes the incident job of #5477 the only writer of incident issues, so this item adds no webhook receiver and no route to issues. It adds a Do this step to each row of the alert table in k8s/README.md and a test that fails on an alert rule with no such row, and it verifies that critical stays on the Mattermost channel with no issue-filing route. The move of warning off chat waits on #5477 and is deferred to a new issue.
Acceptance criteria
Requirement: Critical alerts stay on chat
The Alertmanager configuration SHALL route every critical alert to the Mattermost receiver.
Scenario: The live route test of a critical alert
- WHEN a person runs
kubectl -n monitoring exec statefulset/prometheus-alertmanager -c alertmanager -- amtool config routes test severity=critical - THEN the command prints
mattermostas the receiver.
Requirement: No route files issues
The Alertmanager configuration SHALL define no receiver that files issues and no route to one.
Scenario: The live route tree names only chat and null
- WHEN a person runs
kubectl -n monitoring exec statefulset/prometheus-alertmanager -c alertmanager -- amtool config routes show - THEN the command prints a routing tree whose receivers are only
nullandmattermost.
Requirement: Warning stays on chat in this change
The Alertmanager configuration SHALL keep every warning alert on the Mattermost receiver in this change.
Scenario: The live route test of a warning alert
- WHEN a person runs
kubectl -n monitoring exec statefulset/prometheus-alertmanager -c alertmanager -- amtool config routes test severity=warning - THEN the command prints
mattermostas the receiver.
Requirement: Each alert row gives a Do this step
Each row of the alert table under ## Alerting in k8s/README.md SHALL have a non-empty Do this step.
Scenario: The alert table lists every rule with a step
- WHEN a person runs
uv run devops ci test tests/prometheus/test_k8s_monitoring_alerting.py - THEN the command exits 0 and the test passes for every alert rule with a
Do thisstep.
Requirement: A missing Do this row fails the test
The alert table test SHALL fail when an alert rule has no row with a non-empty Do this step.
Scenario: An alert rule has no Do this row
- WHEN a person adds an alert rule to
k8s/monitoring/prometheus-values.yamlwith no table row and runsuv run devops ci test tests/prometheus/test_k8s_monitoring_alerting.py - THEN the command exits non-zero and the failure names the alert rule with no
Do thisstep.
Existing Tool Considered
false
Key questions
- What scope does the owner decision of 2026-11-13 set for this item?:
criticalalerts stay on the Mattermost alert channel. The incident job of feat(roadmap): add incident and supervise jobs that read the SLOs #5477 is the only writer of incident issues. This item adds no webhook receiver, no route to issues and no bridge. It keeps theDo thiscolumn and its test.warningleaves chat only when feat(roadmap): add incident and supervise jobs that read the SLOs #5477 runs in modeon. (best practice) [sources: k8s/README.md:605]- Chosen: Keep the owner decision of 2026-11-13. The owner accepted the pipeline split design. The design makes the incident job of feat(roadmap): add incident and supervise jobs that read the SLOs #5477 the one writer of incident issues.
- Rejected: Keep the original ticket receiver and issue route. The owner decision removes the ticket receiver, the route to issues and the bridge.
- Does this item move
warningoff the Mattermost route now?: No. No code holds the incident job of feat(roadmap): add incident and supervise jobs that read the SLOs #5477 yet, andwarningstill routes to the Mattermost receiver. The move and its 7-day live proof are deferred to a new issue that waits on feat(roadmap): add incident and supervise jobs that read the SLOs #5477 running in modeon. (best practice) [sources: openspec/changes/archive/2026-11-13-5445-add-the-sre-service-spec/design.md:10, k8s/monitoring/prometheus-values.yaml:111, k8s/README.md:693]- Chosen: Defer the warning move until feat(roadmap): add incident and supervise jobs that read the SLOs #5477 runs in mode
on. The owner decision forbids a gap in warning alerts. The incident job must read warning alerts before chat stops, and no code holds it yet. - Rejected: Move warning now. A move before feat(roadmap): add incident and supervise jobs that read the SLOs #5477 runs in mode
oncan lose warning alerts.
- Chosen: Defer the warning move until feat(roadmap): add incident and supervise jobs that read the SLOs #5477 runs in mode
- What does the
Do thiscolumn hold for each alert?: One non-empty action step for each rule row, in the style of theDo thiscolumn ofdocs/CLUSTER.md: the command or check that resolves the alert. The incident job of feat(roadmap): add incident and supervise jobs that read the SLOs #5477 can then give that step in its issue. (best practice) [sources: docs/guidelines/sre.md:77, docs/guidelines/sre.md:219, docs/guidelines/production-readiness.md:53, k8s/README.md:622]- Chosen: Add a
Do thiscolumn with one step for each rule. The owner decision keeps this part, and the SRE guideline requires a runbook row with aDo thisstep for each alert. - Rejected: Keep the four columns and no action step. A ticket from an alert cannot tell the reader what to do.
- Chosen: Add a
- Where does the test that fails on an alert rule with no
Do thisrow live, and how does it find the rule?: Add the test totests/prometheus/test_k8s_monitoring_alerting.py. It reads the alert rules ofk8s/monitoring/prometheus-values.yamlandk8s/devops/monitoring/prometheus-rules-values.yamland the alert table ofk8s/README.md, and fails naming each rule with no row or an emptyDo thiscell. That module already reads the same files and checks a row ofdocs/CLUSTER.md. (best practice) [sources: tests/prometheus/test_k8s_monitoring_alerting.py:65, tests/prometheus/test_k8s_monitoring_alerting.py:66, tests/prometheus/test_k8s_monitoring_alerting.py:68, tests/prometheus/test_k8s_monitoring_alerting.py:69, tests/prometheus/test_k8s_monitoring_alerting.py:493]- Chosen: Add the test to
tests/prometheus/test_k8s_monitoring_alerting.py. That module already reads the alert rules and the docs, and it checks a row ofdocs/CLUSTER.md. - Rejected: Add a new
tests/commands/k8s/test_alert_runbooks.py. No such file or directory exists, and the alerting tests live intests/prometheus/. - Rejected: Check the table by hand only. A hand check does not fail when a new rule has no row.
- Chosen: Add the test to
- Which command proves that the Alertmanager route keeps
criticalon chat and sends no alert to an issue-filing receiver?: Use the liveamtool config routes testandamtool config routes showin the Alertmanager pod, as the production-readiness guideline names.amtool config routes test severity=criticalprints the receiver, andamtool config routes showprints the route tree with its receivers. A pytest test that readsk8s/monitoring/prometheus-values.yamlis not the proof: the values are a config file, and thek8sgate renders kustomize manifests, not the Helm values of Alertmanager. (best practice) [sources: docs/guidelines/production-readiness.md:54, k8s/README.md:714]- Chosen: Live
amtool config routes testandamtool config routes show. The production-readiness guideline namesamtool config routes testas the check of the page and ticket routes, and the Alertmanager pod holdsamtool. - Rejected: A pytest test that reads the Alertmanager values. A test asserts no value of a config file, and the
k8sgate does not read the Helm values of the Alertmanager config.
- Chosen: Live
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both set Alertmanager routing for critical and warning alerts, but dan-petty/devops-cli#1392 sent both to Mattermost while the candidate splits warning to a webhook that opens issues.dan-petty commentedon Nov 13, 2026
Scope change, with the reason.
The owner accepted the design of the roadmap pipeline split (tracker #5482) on 2026-11-13. That design rejects an Alertmanager route for incident filing. The incident job of #5477 reads the Alertmanager API and is the one writer of incident issues. A second writer, such as a webhook route from Alertmanager to issues, can file two issues for one alert. The accepted design wins over this item.
The body of this item now has the section "Owner decision 2026-11-13":
critical) go to chat only.warning) becomes an issue only through the incident job of feat(roadmap): add incident and supervise jobs that read the SLOs #5477.warningleaves the chat route only when the incident job of feat(roadmap): add incident and supervise jobs that read the SLOs #5477 runs in modeon, so no warning alert is lost in the gap.devops-cli-service commentedon Nov 17, 2026
Alternatives check: none
Reason: The searches turned up no relevant open tool: the results were unrelated documentation pages, and the one candidate the issue names, m-lab/alertmanager-github-receiver, is open and maintained but the owner decision of 2026-11-13 removed the Alertmanager-to-GitHub-issues bridge, the ticket receiver and its check from the scope, because the incident job of #5477 is the single writer of incident issues. What remains is the "Do this" step for each environment alert row in k8s/README.md and an in-repo test that fails on a rule with no such row, which is project documentation and a project test rather than a need that an external tool or library covers.
Tool: none found
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 18, 2026
Status set to Ready at 9be129e (see proposed design in issue body).
Moved to new items: dan-petty/homelab#369.
dan-petty commentedon Nov 19, 2026
Evidence for the
Do thisstep ofAlloyRemoteWriteSamplesFailed, from #6439.From 2026-11-15 to 2026-11-19, each firing of this alert had one cause: two series of one target had the same label set and different values at one timestamp. Prometheus answered HTTP 400
duplicate sample for timestamp, and Alloy dropped the full batch of up to 2,000 samples, also the samples of other targets. Twolabeldroprules of the gateway ServiceMonitor (#5896) made the collisions. The pull request of #6439 removes them.A
Do thisstep that finds the cause:{namespace="monitoring", container="alloy"} |= "non-recoverable error".duplicate sample for timestamp, take theexistingvalue of one line, for exampleV, and find the series that holds it:<family>_created > V < V+1. Thejoblabel names the target. Then look for a relabel rule of that target that drops a label.{namespace="monitoring", container="prometheus-server"} |= "Out of order sample from remote write". On 2026-11-19, Prometheus gave 3,807 HTTP 400 answers in 24 h, and the Alloy log held 1,145 lines.The alert shows only the collisions between batches. Inside one batch, Prometheus keeps the first sample of a label set and drops the rest with no counter (
tsdb/head_append.go:1341-1354at Prometheus v3.16.0). The step can say that a quiet alert does not prove correct values.The OpenSpec tasks of #6439 name this item as the owner of the row.
docs(openspec): name the real exclusion path and the live checks of #…
docs(openspec): name the real exclusion path and the live checks of #…