Skip to content

feat(alerts): warn when a CPU holds near its critical temperature - #1727

Merged
Gerrrt merged 3 commits into
mainfrom
fix/host-cpu-temperature-alert
Nov 24, 2026
Merged

Gerrrt merged 3 commits into
mainfrom
fix/host-cpu-temperature-alert

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Nov 24, 2026

Copy link
Copy Markdown
Owner

What changed

Adds HostCpuHot, a warning in host.rules.yaml. It fires when a host's hottest coretemp core has stayed within 10 °C of that core's own critical temperature for ten minutes. Three promtool tests cover it, and the rule counts in six documents and the changelog are updated.

Why

No rule read node_hwmon_temp_celsius. The audit of prometheus of 2026-11-13 (finding 10) watched the laptop peak at 92 °C against a 105 °C critical. If a fan failed or a vent was blocked, the first page would have been InstanceDown, after the machine had already shut itself down.

The margin is measured, not chosen. Over 29 days of retention, the closest any host held within critical for ten minutes was 22 °C: prometheus, during the audit's own heavy work. Its brief peaks came within 13 °C. So 10 °C for 10 minutes sits past both, and still before the CPU shuts down.

Only platform_coretemp_* chips are read. On other chips the critical value means nothing: smaug's DIMM sensors report a critical point of 0 °C. heimdall (a Pi) has no coretemp.

Blast radius

One new warning-level rule on Prometheus. It is not firing now: queried live with a 60 °C margin, the expression returns prometheus 77, trinity 52 and Saruman 46, so nothing is within 10 °C of critical. If the rule is wrong, it means a spurious or missing warning, and nothing else.

  • No change to network segmentation or firewall rules
  • No new port published to a VLAN that could not already reach the service
  • No credential added outside secrets/*.sops.yaml

Verification

  • promtool check rules rules/host.rules.yaml (prom/prometheus v3.16.0, via docker): SUCCESS: 64 rules found.

  • promtool test rules tests/host.test.yaml: SUCCESS. The first run failed on the missing job label, because a comparison with on (...) keeps only the labels it matches on. The rule now matches on job too.

  • scripts/check_rule_tests.py: every one of 221 alert rules is selected by a test.

  • scripts/check_docs.py: docs OK — 183 Prometheus + 28 Loki rules.

  • scripts/lint.sh: passed.

  • The expression run live against Prometheus, as above.

  • make validate passes — not run locally; CI runs it

  • Deployed to the lab and confirmed working — converge deploys it after merge

  • Docs updated (docs/, service README, or docs/roadmap.md)

Refs the audit of prometheus, finding 10. No issue was filed.

🤖 Generated with Claude Code

HostCpuHot fires when a host's hottest coretemp core has held within
10 °C of its own critical point for ten minutes. Nothing read
node_hwmon_temp_celsius before; the prometheus audit watched the laptop
peak at 92 °C against 105 (finding 10). The margin is measured against
29 days of retention. coretemp only, because smaug's DIMM sensors report
a critical point of 0 °C.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 24, 2026 21:11

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.

🟡 Changes recommended

The CPU temperature tests do not verify the ten-minute hold, so they would miss premature or delayed warnings if the alert duration were removed or changed.

1 open issue
What changed in this PR

Adds HostCpuHot to the host monitoring rules, warning when coretemp readings remain within 10 °C of their own critical temperature for ten minutes.

Changes:

  • Adds a warning-level CPU temperature alert, aggregated by host and job.
  • Adds tests for sustained heat, a below-threshold spike, and excluded non-coretemp sensors.
  • Updates alert totals and documents the new monitoring coverage.
File Description
stacks/​observability/​README.md Updates the Prometheus alert count.
stacks/​observability/​prometheus/​tests/​host.test.yaml Adds three CPU temperature alert scenarios.
stacks/​observability/​prometheus/​rules/​host.rules.yaml Defines HostCpuHot and troubleshooting guidance.
README.md Updates total and Prometheus alert counts.
docs/​security.md Updates the alert count for failure visibility.
docs/​runbooks/​deploy-stack.md Updates expected loaded rule counts.
docs/​observability.md Documents CPU monitoring and updates rule and coverage totals.
docs/​changelog.md Records the alert and its threshold rationale.

Review effort: Balanced

@Gerrrt
Gerrrt enabled auto-merge (squash) November 24, 2026 21:16
Gerrrt and others added 2 commits November 24, 2026 21:33
Quiet at 5m and firing at 10m on the sustained-hot fixture, so removing
`for: 10m` or lengthening it fails a test. Review on #1727.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt
Gerrrt merged commit acdbf19 into main Nov 24, 2026
9 checks passed
@Gerrrt
Gerrrt deleted the fix/host-cpu-temperature-alert branch November 24, 2026 21:51
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