fix(prometheus): name the laptop cell runbook, not the UPS one (#454) - #506
Merged
Merged
Conversation
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
force-pushed
the
gerrrt/battery-health-runbook-ref-9c4e21
branch
from
September 18, 2026 02:41
5cf3e47 to
d2e9cad
Compare
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.
HostBatteryHealthLowreads a laptop cell's measured full capacity against its design figure, and fires today fororacle's BAT0 at 72 %. Its description sent the reader todocs/runbooks/fit-the-ups-battery.md— the rack pack inmjolnir: 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.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 invalidate.shchecks 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_annotationsblocks intests/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
HostOnBatteryandHostBatteryNotReportedwere checked and deliberately left alone: neither names a runbook, so neither had a wrong one. Each already carries its own next step in prose —UpsOnBatteryandnode_power_supply_capacityfor the first,/sys/class/power_supply/for the second.The
fit-the-ups-battery.mdreference 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_urlannotation was added — this repo names runbooks as bare repo-relative paths inside the description prose, and that style is kept.Verified
promtool test rulesontests/host.test.yaml, via docker with the pinnedprom/prometheus:v3.14.0image — SUCCESS. (make check-rulesinvokes a barepromtool, which is not onPATHon this host.)./scripts/validate.sh— exit 0, all checks passed, includingobservability: promtool test rules (11 file(s)). The 3 skips are the systemd unit checks that only run in the deployment checkout.promtool test rulesafter rebasing onto the currentmain— still SUCCESS.Refs #454
🤖 Generated with Claude Code