feat(worker): add lk_agents_worker_full_total counter for full-capacity transitions#6389
Open
AKomplished-bug wants to merge 1 commit into
Open
Conversation
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.
Summary
Fixes #6388.
The worker's load is exported as an instantaneous gauge (
lk_agents_worker_load), but admission control marks the workerWS_FULLon the continuous 0.5s load loop. A spike that puts the worker over threshold for less than one scrape/export interval is invisible to the gauge — the FULL transition falls between samples, so dashboards can't see (or alert on) saturation that actually rejected/deferred jobs.Change
Add
lk_agents_worker_full_total, a monotonicCounterlabellednodename, incremented once per FULL transition at the existing status-change edge in_update_worker_status(guarded byself._previous_status != status, alongside the "full capacity" log line). Being a counter, it never loses an event to sampling, and it rides the same Prometheus→OTLP path as the existing gauges, so it works in both scrape and push deployments.Operators can then alert on
rate(lk_agents_worker_full_total[5m]).Testing
tests/test_worker_full_metric.py— asserts the counter increments per transition and is labelled by node name.ruff check+ruff formatclean.mypy(full repo viascripts/check_types.py): no issues found in 617 source files.