Skip to content

fix(lab): eden reports patch state, and PatchStateStopped skips it while off - #1588

Merged
Gerrrt merged 1 commit into
mainfrom
fix/eden-patch-state
Nov 19, 2026
Merged

Gerrrt merged 1 commit into
mainfrom
fix/eden-patch-state

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 19, 2026

Copy link
Copy Markdown
Owner

What changed

  • stacks/lab/prometheus/rules/lab.rules.yaml: PatchStateStopped's vanished-series branch leaves out an on-demand guest (eden) while none of its node metrics (node_boot_time_seconds) have arrived in an hour. The comment explains why the guest is named rather than read from a tag.
  • stacks/lab/prometheus/tests/lab.test.yaml: two cases. A shut-down eden is quiet at 3 d and 10 d. A running eden without its collector fires.
  • docs/runbooks/build-the-bloodhound-guest.md §6: installs the patch-state collector before the guest is shut down.
  • docs/changelog.md: a 2026-11-19 entry.

Why

Redeploying the lab after #1585 put PatchStateStopped in pending for eden. It reported from 2026-11-08 until 23:04 UTC on 2026-11-12, then stopped when it was rebuilt the next morning. The old guest's timer had been installed by hand, the runbook had no such step, and the old [1d] window had quietly cleared the alert by 11-14.

eden is on-demand and off between sessions. Without the exclusion, the rule would fire six hours after every session ends, which is the always-firing shape ADR-0079 removed from HypervisorGuestStopped. The lab can't read Saruman's Proxmox tags, so the guest is named in the rule, the same way role="endpoint" names the domain's endpoints.

Blast radius

  • Lab only, and nothing pages there (ADR-0020). It takes effect after make up STACK=lab on alexander.
  • While eden is off, a broken collector on it goes unseen. While it runs, it alerts like any other guest.
  • Every other lab guest is unchanged.

Verification

  • promtool test rules tests/lab.test.yaml: SUCCESS.
  • Mutation: with the exclusion matching no host, the shut-down case fails.
  • python3 scripts/check_docs.py: OK.
  • On eden after the install: the timer is scheduled, apt-patch-state.prom was written at 20:29 UTC with mode 644, and the lab reads homelab_apt_upgrades_pending{host="eden"} 9.
  • Not run locally: make validate and the Docker-based lint tools (no Docker on the Mac). CI runs them.

🤖 Generated with Claude Code

…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>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 20:31
@Gerrrt
Gerrrt enabled auto-merge (squash) November 19, 2026 20:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified in the change to suppress stopped-collector alerts while the on-demand guest is powered off.

No open issues 🎉

What changed in this PR

Updates lab patch-state monitoring so the on-demand guest eden does not trigger a stopped-collector alert while powered off, following the longer alert lookback introduced in #1585.

Changes:

  • Suppresses the vanished-series alert for eden when no node metrics have arrived for an hour, while preserving detection when it is running.
  • Adds tests for shutdown and running-without-collector scenarios.
  • Documents collector installation during guest setup and records the change.
File Description
stacks/​lab/​prometheus/​tests/​lab.test.yaml Tests alert suppression while off and detection while running.
stacks/​lab/​prometheus/​rules/​lab.rules.yaml Adds the on-demand exclusion to PatchStateStopped.
docs/​runbooks/​build-the-bloodhound-guest.md Adds patch-state collector installation and verification.
docs/​changelog.md Records the collector restoration and alert behavior change.

Review effort: Balanced

@Gerrrt
Gerrrt merged commit 6e71662 into main Nov 19, 2026
10 checks passed
@Gerrrt
Gerrrt deleted the fix/eden-patch-state branch November 19, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants