Repository navigation
feat(observability): label a wait with why the task was not running - #412
Draft
yuechao-qin wants to merge 1 commit into
Draft
yuechao-qin wants to merge 1 commit into
yuechao-qin wants to merge 1 commit into
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.
What
PENDINGcovers two unrelated failures with one number: a task waiting for capacitythat does not exist, and a task that is simply misconfigured. A four-hour wait looks
identical either way. This labels both instruments with why, so an alert can tell them
apart.
Why
A latency alert that cannot see the reason routes both cases the same way. The capacity
rule assumes a slow multi-GPU task means scarcity, so a task stuck on
CreateContainerConfigErrorpages the wrong people — and a genuine shortage lands in achannel nobody is on call for.
waiting_for_nodeimage_unavailablebad_configChanges
execution.pending_reason, on the transition histogram and on the slow counter.A closed vocabulary, not the Kubernetes string
The raw reason is an open set a Kubernetes release can grow, so it is mapped rather than
labelled:
containerStatusesyetwaiting_for_nodeContainerCreating,PodInitializingstarting_containerImagePullBackOff,ErrImagePull,ImageInspectError,RegistryUnavailableimage_unavailableInvalidImageName,CreateContainerConfigError,CreateContainerErrorbad_configothernoneSix values, fixed. A Kubernetes release adding a reason widens
other; it cannot add aseries.
The reason has to be captured before it is needed
By the time a task stops waiting, its pod is running and
waiting.reasonis gone. So itis stamped on the way through, during the wait:
ContainerExecution.launcher_data, which theorchestrator assigns on every sweep that sees a change — the only thing that updates
while the status does not
database read happen on the sweep path
it would have to be fetched, the point is labelled
nonerather than putting aSELECTinside the flush in progressCardinality
The histogram is the expensive half: it is a native histogram, so each new label value
multiplies buckets. The bound is ×6, and only transitions leaving
PENDINGcan carrya value other than
none— the realised multiplier is lower, but it has not beenmeasured against production yet.
Tests
otherrather than its own label valuewaiting_for_node