Skip to content

fix(prometheus): name the laptop cell runbook, not the UPS one (#454) - #506

Merged
Gerrrt merged 1 commit into
mainfrom
gerrrt/battery-health-runbook-ref-9c4e21
Sep 18, 2026
Merged

Gerrrt merged 1 commit into
mainfrom
gerrrt/battery-health-runbook-ref-9c4e21

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Sep 17, 2026

Copy link
Copy Markdown
Owner

HostBatteryHealthLow reads a laptop cell's measured full capacity against its design figure, and fires today for oracle's BAT0 at 72 %. Its description sent the reader to docs/runbooks/fit-the-ups-battery.md — the rack pack in mjolnir: an APCRBC115 in a Smart-UPS, a self-test to watch, an NMC to read. None of that applies to a thirteen-year-old cell in a laptop on a shelf, so the one alert whose entire action is "order the replacement" pointed at the wrong hardware.

It now names docs/runbooks/replace-the-laptop-cell.md, which carries the baseline, the fit, the mains-pull test, the stack-down window and the disposal. Because that runbook covers the before as well as the after, the sentence now reads "what to check before and after the swap" rather than only after.

⚠️ Merge order

That runbook lands with #497, which is still open. This PR should not merge ahead of it — otherwise the annotation names a path that does not yet exist on main. Nothing in validate.sh checks that a runbook path in rule prose resolves, so CI will not catch it; the ordering has to be held by hand.

Why the test moves too

The description is asserted verbatim in two exp_annotations blocks in tests/host.test.yaml, so rule and assertions had to change in the same commit. Line-wrapping differs between the two files and always has — the folded scalars were compared as strings to confirm they still produce identical text.

The other two rules in the block

HostOnBattery and HostBatteryNotReported were checked and deliberately left alone: neither names a runbook, so neither had a wrong one. Each already carries its own next step in prose — UpsOnBattery and node_power_supply_capacity for the first, /sys/class/power_supply/ for the second.

The fit-the-ups-battery.md reference in the block's header comment also stays. It cites that document for stating the shelf's mains-cut design, which is still true, not for how to change a cell.

No runbook_url annotation was added — this repo names runbooks as bare repo-relative paths inside the description prose, and that style is kept.

Verified

  • promtool test rules on tests/host.test.yaml, via docker with the pinned prom/prometheus:v3.14.0 image — SUCCESS. (make check-rules invokes a bare promtool, which is not on PATH on this host.)
  • Negative control: reverting one of the two assertions to the old path was confirmed to FAIL the run, proving the annotation is genuinely asserted and not silently ignored.
  • ./scripts/validate.shexit 0, all checks passed, including observability: promtool test rules (11 file(s)). The 3 skips are the systemd unit checks that only run in the deployment checkout.
  • Re-ran promtool test rules after rebasing onto the current main — still SUCCESS.

Refs #454

🤖 Generated with Claude Code

HostBatteryHealthLow reads a laptop cell's measured full capacity against
its design figure, and fires today for oracle's BAT0 at 72 %. Its
description sent the reader to docs/runbooks/fit-the-ups-battery.md,
which is the rack pack in mjolnir: an APCRBC115 in a Smart-UPS, a
self-test to watch and an NMC to read. None of that is what you do with a
thirteen-year-old cell in a laptop on a shelf, so the one alert whose
whole action is "order the replacement" pointed at the wrong hardware.

It now names docs/runbooks/replace-the-laptop-cell.md, which carries the
baseline to take first, the fit, the mains-pull test that proves it, the
stack-down window and the disposal. Because that runbook covers the
before as well as the after, the sentence reads "what to check before and
after the swap" rather than only after.

That runbook lands with #497, which is still open — this change should
not merge ahead of it, or the annotation names a path that does not yet
exist on main.

The description is asserted verbatim in two exp_annotations blocks in
tests/host.test.yaml, so the rule and both assertions move together.
Line-wrapping differs between the two files and always has; the folded
scalars were compared as strings to confirm they still produce identical
text.

HostOnBattery and HostBatteryNotReported were checked and left alone:
neither names a runbook, so neither had a wrong one. Each already carries
its own next step in prose — UpsOnBattery and node_power_supply_capacity
for the first, /sys/class/power_supply for the second. The
fit-the-ups-battery.md reference in the block's header comment also
stays: it cites that document for stating the shelf's mains-cut design,
which is still true, not for how to change a cell.

Verified: `promtool test rules` on tests/host.test.yaml via docker with
the pinned prom/prometheus:v3.14.0 image (the Makefile's check-rules
target calls a bare `promtool`, which is not on PATH on this host) —
SUCCESS. Reverting one of the two assertions to the old path was
confirmed to FAIL the run, proving the annotation is genuinely asserted
and not silently ignored. `./scripts/validate.sh` exits 0, all checks
passed, including "observability: promtool test rules (11 file(s))";
the 3 skips are the systemd unit checks that only run in the deployment
checkout.

Refs #454

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Gerrrt
Gerrrt force-pushed the gerrrt/battery-health-runbook-ref-9c4e21 branch from 5cf3e47 to d2e9cad Compare September 18, 2026 02:41
@Gerrrt
Gerrrt merged commit 93be559 into main Sep 18, 2026
3 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/battery-health-runbook-ref-9c4e21 branch September 18, 2026 03:05
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.

1 participant