feat(runner-controller): break queue wait down by state #592
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra!592
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "feat/runner-queue-wait-states"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Closes #567. Follows #591 (merged).
The pickup gauges said how long a job waited, not why.
Change
at_cap,quota,booting,registering,unclaimedorcontroller_error. It uses only data the loop already reads.bitborg_runner_controller_queue_wait_seconds_total{state}bitborg_runner_controller_queued_jobs_by_state{state}bitborg_runner_controller_pickup_seconds_max_15mcontroller_errorand never block VM creation.registering.RunnerPickupSlowreads the 15-minute max withfor: 5m, so one slow pickup fires and the alert clears about 15 minutes after. The threshold variable is renamedalert_runner_pickup_max_seconds.active_vmsgauge now counts VMs actually booted this cycle, not the planned number.Tests
test_controller_logic.py: 109/109.check-metric-names.pyandcheck-alert-rules.py(53 rules, self-test 4/4) pass. Pre-push hooks pass.Not exercised: an end-to-end
reconcile()run. The new wiring is covered by unit tests of its helpers.Book every second a queued job waits to one state: at_cap, quota, booting, registering, unclaimed or controller_error. Uses the server, runner and queue reads the loop already makes. No new API calls. spent_counted_idle is dropped. The previous commit removes the condition it described. - Counter queue_wait_seconds_total{state} and gauge queued_jobs_by_state{state}. The queued_jobs gauge is unchanged. - Persist first-seen times in queued_first_seen.json beside the metrics file. Atomic write. A missing or corrupt file starts empty. - Add pickup_seconds_max_15m. RunnerPickupSlow reads it, so it clears after the queue drains. The threshold variable is unchanged. - Add a stacked queue-wait-by-state panel to the runners dashboard. - Runbook: read the new panel first on slow CI.