Repository navigation
fix(alerts): stopped-collector rules hold for two weeks, not a day - #1585
Merged
Merged
Conversation
PatchStateStopped (estate and lab) and GuestStateStopped looked back [1d] offset 6h, so about 30 h after the last sample the "was reporting" side emptied and the alert resolved with nothing recovered. They now look back 14 days, inside both Prometheuses' retention. New promtool cases fire at 3 d and 10 d and are quiet at 16 d; with [1d] put back the 3 d and 10 d cases fail. The sensor runbook's sshd step also removes cloud-init's 50-cloud-init.conf, now removed on fenrir. The changelog records both, and that alexander's pending security updates are Ubuntu's phasing. Refs #1580 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ch-state-stopped-absence # Conflicts: # docs/changelog.md
Gerrrt
enabled auto-merge (squash)
November 19, 2026 18:54
There was a problem hiding this comment.
🟡 Changes recommended
The stopped-guest expiry lacks a 16-day test, the changelog overstates detection of stopped collectors, and the lab retirement guidance recommends silencing an alert without Alertmanager.
3 open issues
What changed in this PR
Extends the HomeLab’s missing-series alerts so they remain active for roughly two weeks instead of clearing after about a day. It also documents SSH drop-in cleanup for the sensor guest.
Changes:
- Expands patch-state and guest-state alert lookbacks to 14 days.
- Adds long-gap regression cases for the updated alerts.
- Updates the sensor runbook and records the alert changes and operational observations.
| File | Description |
|---|---|
stacks/observability/prometheus/tests/host.test.yaml |
Adds long-gap patch-state and guest-state alert cases. |
stacks/observability/prometheus/rules/host.rules.yaml |
Extends patch-state and guest-state lookbacks and updates explanations. |
stacks/lab/prometheus/tests/lab.test.yaml |
Tests patch-state firing at 3 and 10 days, then expiry at 16 days. |
stacks/lab/prometheus/rules/lab.rules.yaml |
Extends the missing patch-state series lookback. |
docs/runbooks/build-the-sensor-guest.md |
Removes cloud-init’s SSH drop-in and checks the remaining configuration. |
docs/changelog.md |
Records alert changes, phased updates, and SSH cleanup. |
Review effort: Balanced
Review on #1585: - The estate's PatchStateStopped and GuestStateStopped see a series vanish, not a timer that stops and leaves its .prom file, which is re-served on every scrape. The rule comments and changelog now say so; the lab's copy has an mtime branch, the estate's do not yet. - The lab has no Alertmanager (ADR-0020), so its rule comment no longer says to silence a retired guest. - GuestStateStopped's long-gap test now also asserts quiet at 16 d. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ch-state-stopped-absence # Conflicts: # docs/changelog.md
Gerrrt
added a commit
that referenced
this pull request
Nov 19, 2026
PatchStateStopped and GuestStateStopped fired only when their series vanished. A collector whose timer stops leaves its .prom in the textfile directory and node_exporter re-serves it, so the series stays present and neither rule saw it. Each gains a second branch on node_textfile_mtime_seconds, as the lab's PatchStateStopped has (#1544): apt-patch-state.prom older than two days, guest-state.prom older than an hour, with label_replace copying `instance` into `host`. Promtool cases fire with the file frozen and stay quiet with it rewritten beside an old file of another collector; removing either branch or loosening either regex to `.*state\.prom` fails them. Refs #1585. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 of 6 tasks
Gerrrt
added a commit
that referenced
this pull request
Nov 19, 2026
…ile (#1587) PatchStateStopped and GuestStateStopped fired only when their series vanished. A collector whose timer stops leaves its .prom in the textfile directory and node_exporter re-serves it, so the series stays present and neither rule saw it. Each gains a second branch on node_textfile_mtime_seconds, as the lab's PatchStateStopped has (#1544): apt-patch-state.prom older than two days, guest-state.prom older than an hour, with label_replace copying `instance` into `host`. Promtool cases fire with the file frozen and stay quiet with it rewritten beside an old file of another collector; removing either branch or loosening either regex to `.*state\.prom` fails them. Refs #1585. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt
added a commit
that referenced
this pull request
Nov 19, 2026
…ile off Redeploying the lab after #1585 put PatchStateStopped in pending for eden: it stopped reporting at its rebuild on 2026-11-13, because the old guest's timer was installed by hand and build-the-bloodhound-guest.md had no such step. The [1d] window had cleared the alert by 11-14. - The runbook's section 6 installs the patch-state collector; it is installed on eden and the lab reads it. - eden is on-demand (ADR-0079), so the rule's vanished-series branch leaves it out while none of its node metrics have arrived in an hour. A running eden with a dead collector still fires. - promtool: shut-down eden quiet at 3d and 10d, running eden without its collector fires; removing the exclusion fails the first case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gerrrt
added a commit
that referenced
this pull request
Nov 19, 2026
…ile off (#1588) Redeploying the lab after #1585 put PatchStateStopped in pending for eden: it stopped reporting at its rebuild on 2026-11-13, because the old guest's timer was installed by hand and build-the-bloodhound-guest.md had no such step. The [1d] window had cleared the alert by 11-14. - The runbook's section 6 installs the patch-state collector; it is installed on eden and the lab reads it. - eden is on-demand (ADR-0079), so the rule's vanished-series branch leaves it out while none of its node metrics have arrived in an hour. A running eden with a dead collector still fires. - promtool: shut-down eden quiet at 3d and 10d, running eden without its collector fires; removing the exclusion fails the first case. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What changed
PatchStateStopped(host.rules.yamlandlab.rules.yaml) andGuestStateStopped(host.rules.yaml) look back[14d] offset 6hinstead of[1d] offset 6h. Comments and descriptions say why, and that a host retired on purpose now fires for two weeks.host.test.yamlandlab.test.yaml: a collector that stops still fires at 3 d and 10 d, and is quiet at 16 d.build-the-sensor-guest.md§3 removes cloud-init's50-cloud-init.confand checks that only10-homelab.confis left.docs/changelog.md: a2026-11-19heading with three entries: the rule fix,alexander's phased security updates, andfenrir's drop-in.Why
Review of #1580's
ApplianceStateStoppedfound that the "reported before, not in the last six hours" form these rules copied empties its left side about 30 h after the last sample, so the alert resolved by itself while the collector was still dead. The 2026-11-13 audit had to guessfenrir'ssshdfrom the 27-bytePasswordAuthentication yesfile, which the10-drop-in already outranked; removing it means the next audit has nothing to flag.Refs #1580
Blast radius
make up STACK=observabilityon the estate host andmake up STACK=labonalexander.PatchStateStoppedon reload; silence it.fenrirby hand: only10-homelab.confremains,sshis active, and the appliance check'ssshdrow reads 1.Verification
promtool test rulespasses forhost.test.yamlandlab.test.yaml;promtool check rulesloads 62 and 25 rules.[1d]restored, the 3 d and 10 d cases fail.python3 scripts/check_docs.py: OK../scripts/lint.shon the Mac: same result asmain; markdownlint-cli2, zizmor, packer, tofu and editorconfig-checker skipped (no Docker), ansible-lint fails as onmain. CI runs them all.🤖 Generated with Claude Code