With every slot busy, poll() slept a fixed second before asking for work again, so throughput was capped at slots per second, not at what the machine can do. Raising the concurrency only moved the cap. Under load, runs piled up in the checker's Redis queue and started late.
The loop now waits for the first freed slot, but at most 5 s (fullHeartbeat), so a fully busy checker still polls as a heartbeat (well below StaleAfter = 45 s).
TestFullCheckerTakesWorkAsSlotsFree pushes 10 jobs through one slot. The old code ran 5 of them in 5 s; the new code runs all 10 in milliseconds.
Overdue metric and alert rules
uptimesebi_checks_overdue only counted the due set. Dispatch moves due runs into an instance's queue and schedules the next run at once, so a saturated checker left the metric at 0. Scheduler.Overdue now also counts queued runs that were due more than 10 s ago, in one Lua script per region.
The chart gets an optional PrometheusRule (api.metrics.prometheusRule.enabled, default off):
UptimeSebiRegionBehind: max by (region) (uptimesebi_checks_overdue) > 0 for regionBehindFor (5m).
UptimeSebiPlatformMetricsFailing: the platform metrics cannot be read for 10m, which would otherwise blind the first alert.
kube-prometheus-stack in prod selects rules with release: monitoring, so set that label in api.metrics.prometheusRule.labels.
Tests
go test ./... with DB and Redis, and golangci-lint: green.
helm lint, plus helm template with and without the rule.
Dev stack: /metrics serves checks_overdue per region through the new script.
## Checker: take work as soon as a slot frees
With every slot busy, `poll()` slept a fixed second before asking for work again, so throughput was capped at *slots per second*, not at what the machine can do. Raising the concurrency only moved the cap. Under load, runs piled up in the checker's Redis queue and started late.
The loop now waits for the first freed slot, but at most 5 s (`fullHeartbeat`), so a fully busy checker still polls as a heartbeat (well below `StaleAfter` = 45 s).
`TestFullCheckerTakesWorkAsSlotsFree` pushes 10 jobs through one slot. The old code ran 5 of them in 5 s; the new code runs all 10 in milliseconds.
## Overdue metric and alert rules
`uptimesebi_checks_overdue` only counted the due set. Dispatch moves due runs into an instance's queue and schedules the next run at once, so a saturated checker left the metric at 0. `Scheduler.Overdue` now also counts queued runs that were due more than 10 s ago, in one Lua script per region.
The chart gets an optional `PrometheusRule` (`api.metrics.prometheusRule.enabled`, default off):
- `UptimeSebiRegionBehind`: `max by (region) (uptimesebi_checks_overdue) > 0` for `regionBehindFor` (5m).
- `UptimeSebiPlatformMetricsFailing`: the platform metrics cannot be read for 10m, which would otherwise blind the first alert.
kube-prometheus-stack in prod selects rules with `release: monitoring`, so set that label in `api.metrics.prometheusRule.labels`.
## Tests
- `go test ./...` with DB and Redis, and golangci-lint: green.
- `helm lint`, plus `helm template` with and without the rule.
- Dev stack: `/metrics` serves `checks_overdue` per region through the new script.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
With every slot busy, the poll loop paused a fixed second before asking
for work again, so a checker took at most one batch of its slots per
second, whatever its machine could do. Under load, runs piled up in the
checker's queue and started late.
The loop now waits for the first freed slot, at most fullHeartbeat (5s),
so a checker whose slots stay busy still polls as a heartbeat.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
uptimesebi_checks_overdue counted only runs not dispatched yet. Dispatch
hands due runs to an instance's queue and schedules the next run at once,
so a checker too busy to take its work left the metric at 0. It now also
counts queued runs due more than 10 seconds ago.
The chart adds an optional PrometheusRule (api.metrics.prometheusRule):
UptimeSebiRegionBehind fires when a region's checks stay overdue, and
UptimeSebiPlatformMetricsFailing when the platform metrics cannot be read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
Sebi
merged commit 6d4842f4a3 into main2026-11-29 13:35:08 +00:00
Sebi
deleted branch fix/checker-slot-wait2026-11-29 13:35:10 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Checker: take work as soon as a slot frees
With every slot busy,
poll()slept a fixed second before asking for work again, so throughput was capped at slots per second, not at what the machine can do. Raising the concurrency only moved the cap. Under load, runs piled up in the checker's Redis queue and started late.The loop now waits for the first freed slot, but at most 5 s (
fullHeartbeat), so a fully busy checker still polls as a heartbeat (well belowStaleAfter= 45 s).TestFullCheckerTakesWorkAsSlotsFreepushes 10 jobs through one slot. The old code ran 5 of them in 5 s; the new code runs all 10 in milliseconds.Overdue metric and alert rules
uptimesebi_checks_overdueonly counted the due set. Dispatch moves due runs into an instance's queue and schedules the next run at once, so a saturated checker left the metric at 0.Scheduler.Overduenow also counts queued runs that were due more than 10 s ago, in one Lua script per region.The chart gets an optional
PrometheusRule(api.metrics.prometheusRule.enabled, default off):UptimeSebiRegionBehind:max by (region) (uptimesebi_checks_overdue) > 0forregionBehindFor(5m).UptimeSebiPlatformMetricsFailing: the platform metrics cannot be read for 10m, which would otherwise blind the first alert.kube-prometheus-stack in prod selects rules with
release: monitoring, so set that label inapi.metrics.prometheusRule.labels.Tests
go test ./...with DB and Redis, and golangci-lint: green.helm lint, plushelm templatewith and without the rule./metricsserveschecks_overdueper region through the new script.🤖 Generated with Claude Code
https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3