feat(metrics): count preemption failures by reason - #2111
Open
Thezone-1 wants to merge 1 commit into
Open
Conversation
total_preemption_attempts increments only on success, so it counts
preemptions rather than attempts. Deprecate it in favour of the labelled
podgroups_scheduled_by_action / podgroups_acted_on_by_action pair, and add
preemption_failures_total{reason} for the side that was missing.
Attempts that reach scenario search are already broken down by
scenario_search_jobs_total, but a preemptor rejected for putting its queue
over quota returns before the solver and produced no row at all. It now
carries its own terminal search result, so every attempt lands in exactly
one of scheduled or failed.
Signed-off-by: Thezone-1 <somoprovobhattacharjee@gmail.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.
Description
Two things, both in the preempt action's metrics.
total_preemption_attemptsis incremented inside theif succeededbranch, so it counts preemptions that happened, not attempts. Anyone building a success rate from the name gets a wrong answer with no error. It is also redundant:podgroups_scheduled_by_action{action="preempt"}is incremented on the next line under the identical condition, andpodgroups_acted_on_by_action{action="preempt"}already counts the attempts. This marks it deprecated in its help text and in METRICS.md and points at that pair. The increment is left where it is, so no existing dashboard changes value. Say the word if you would rather drop it outright or move the increment, and I will do that here instead.The side that was actually missing is failure with a reason.
scenario_search_jobs_total{action="preempt", result}already covers everything that reaches the solver, but a preemptor rejected byIsNonPreemptibleJobOverQueueQuotaFnreturns before the solver and produced no row anywhere. This addspreemption_failures_total{reason}and gives that early return its own terminalSearchResult, so every attempt now lands in exactly one of scheduled or failed:The new reason is deliberately not
not_attempted. That value is inshouldStopActionForSearchResult's stop set, and returning it there would abandon the preempt action for every job still queued behind this one. There is a test pinning that.I left the pod-group and queue-level metrics from the issue out of this PR. Those need your call on the cardinality question first, and this half stands on its own.
Related Issues
Fixes #2053
Checklist
Breaking Changes
None.
total_preemption_attemptskeeps its current values and semantics, it is only documented as deprecated.Additional Notes
I could not run
make changelogon this checkout, the Makefile stops with "The OS is not supported" on Windows, so the fragment was written byte-for-byte in the format the non-interactive branch of the target emits. Happy to regenerate it.