Repository navigation
fix(alerts): UpsOnBattery pages on a transfer one scrape catches - #1704
Merged
Merged
Conversation
The 82-second transfer of 2026-11-21 was read once at 42 s; '> 0 for 30s' went pending and cleared. Fire on max_over_time(...[2m]) > 30 instead, and replay both the 11-21 and the 1-second 11-07 transfers in ups.test.yaml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The alert timing claim omits the 45-second SNMP scrape timeout and conflates rule firing with page delivery, risking premature attribution of a missing page to the card.
1 open issue
What changed in this PR
This PR updates UPS alerting so a single scrape observing more than 30 seconds on battery can trigger UpsOnBattery, addressing the missed 82-second transfer.
Changes:
- Replaces the 30-second pending period with a two-minute lookback.
- Adds regression coverage for the observed 42-second reading and a one-second transfer that should not alert.
- Updates troubleshooting timing guidance and records the change.
| File | Description |
|---|---|
stacks/observability/prometheus/tests/ups.test.yaml |
Adds short-transfer firing, non-firing, and clearing checks. |
stacks/observability/prometheus/rules/ups.rules.yaml |
Uses max_over_time(...[2m]) > 30 without a pending period. |
docs/runbooks/shut-down-on-the-ups.md |
Revises the documented alert timing allowance. |
docs/changelog.md |
Records the missed transfer and alerting change. |
Review effort: Balanced
Gerrrt
enabled auto-merge (squash)
November 24, 2026 03:53
…plits firing from delivery 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
UpsOnBatterywasupsSecondsOnBattery > 0for 30s. It is nowmax_over_time(upsSecondsOnBattery[2m]) > 30with nofor, so any scrape that reads more than 30 seconds on battery pages.ups.test.yamlgains a case that replays the 2026-11-21 transfer, read once at 42 s, which fires. The same case replays the 1-second transfer of 2026-11-07, which does not.shut-down-on-the-ups.mdnow gives the page's outside limit as two and a half minutes. There is also a changelog entry.Why
On 2026-11-21 the UPS ran on battery for 82 seconds, and nothing paged. Scrapes are a minute apart, so only one read the transfer. The alert went pending and cleared before its
forcould run out. The finding came from reading the card's event log during themjolniraudit.Blast radius
Paging for
mjolnironly. The risk is extra pages: a transfer that lasts 30 to 90 seconds now pages, where before it could pass silently. It also stays firing for up to two minutes after mains return.secrets/*.sops.yamlVerification
promtool test rules tests/ups.test.yaml, run in the pinned Prometheus image: SUCCESS../scripts/lint.sh: passes.python3 scripts/check_docs.py: passes.Prometheus history for 2026-11-21:
upsSecondsOnBatteryread 42 at 17:53 UTC, andALERTS{alertname="UpsOnBattery"}was pending at 17:54 only.make validatewas not run locally; CI runs it.make validatepassesDeployed to the lab and confirmed working
Docs updated (
docs/, service README, ordocs/roadmap.md)🤖 Generated with Claude Code