fix(observability): name the engine's own settle counts apart from the command's - #971
Draft
aparajon wants to merge 2 commits into
Draft
fix(observability): name the engine's own settle counts apart from the command's#971aparajon wants to merge 2 commits into
aparajon wants to merge 2 commits into
Conversation
…e command's A cancel writes two log lines a hop apart that both carry cancelled_count and skipped_count meaning different things. The command's counts say how many tasks the operator's request selected; the engine's say how many it settled in the immediate attempt, routinely zero because the engine defers to the apply owner. Read together during triage, a zero looks like a cancel that selected nothing rather than one that is still queued and working. The engine's counts now log under engine_cancelled_count / engine_stopped_count / engine_skipped_count on both the cancel and stop immediate-attempt paths, so the two sets can never be mistaken for each other in a log search. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Clarifies observability during stop/cancel control operations by disambiguating “command-selected” task counts from “engine-settled” task counts in logs, reducing operator confusion when the engine legitimately defers work to the apply owner.
Changes:
- Renames immediate-settle log fields on the stop path to
engine_*-prefixed keys. - Renames immediate-settle log fields on the cancel path to
engine_*-prefixed keys. - Adds a test asserting the cancel path logs use
engine_*keys (and do not reuse the command-level key names).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/api/control_handlers.go | Renames immediate-settle log keys for stop/cancel and documents why engine vs command counts must be named apart. |
| pkg/api/control_handlers_test.go | Adds coverage asserting cancel immediate-settle logs use engine_*-prefixed count keys. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The stop path carries the same key collision the cancel test covers, and only cancel was pinned. A stop the engine declines is where an operator is most likely to read the engine's counts next to the command's, so assert that line reports engine_stopped_count / engine_skipped_count and never the command's key names. Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Why this matters
During a cancel, two different numbers appear under the same key names a line apart in the logs. The command's counts say how many tasks the operator's request selected; the engine's say how many it settled in this attempt — routinely zero when the engine defers to the apply owner. Reading the engine's zero as the command's is how an operator concludes a cancel did nothing when it is simply still queued.
What it does
engine_-prefixed keys on both the cancel and stop immediate-settle paths, so a zero there reads as "the engine deferred to the apply owner" rather than "the command selected nothing".The doc-comment ambiguity exists identically on both paths, so fixing only the one that was reported would have left the other reading the same way.
🤖 Generated with Claude Code