fix(orchestrator): scope batch claim-error metric to process op#282
Closed
albertywu wants to merge 1 commit into
Closed
fix(orchestrator): scope batch claim-error metric to process op#282albertywu wants to merge 1 commit into
albertywu wants to merge 1 commit into
Conversation
In the batch controller, every infrastructure-error counter is emitted under the `process` operation subscope via metrics.NamedCounter (e.g. deserialize_errors, storage_errors, counter_errors, batch_store_errors, conflict_analyzer_errors, batch_dependent_store_errors, publish_errors), landing at batch_controller.process.*_errors. The request-claim failure path was the lone exception: it incremented c.metricsScope.Counter( "request_claim_errors") directly, emitting at batch_controller. request_claim_errors — one scope level above its siblings. The deferred op.Complete(err) still bumps process.failed on that path, so when an operator attributes a process.failed spike by summing process.*_errors, the total is silently short by the request_claim_errors count. Routing it through metrics.NamedCounter restores the per-category breakdown so it reconciles with process.failed. The ack-path outcome counters (skipped_halted, request_claim_lost_race) intentionally stay at controller scope, matching the skipped_* convention in the score and speculate controllers; only error counters belong under the operation subscope. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a metrics scoping inconsistency in the batch-phase orchestrator controller so that request_claim_errors is emitted under the same process operation subscope as the other per-category infrastructure error counters, keeping the error breakdown reconcilable with process.failed.
Changes:
- Routes
request_claim_errorsthroughmetrics.NamedCounter(c.metricsScope, opName, ...)instead of incrementing the controller-level counter directly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
.