fix(observability): Fix executing operation gauge decrement on error#7267
Merged
koushiro merged 1 commit intoapache:mainfrom Mar 24, 2026
Merged
Conversation
Contributor
Author
|
The CI error doesn't seem to be caused by my change. error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to
'C:\Users\runneradmin\.rustup\tmp\b5wk0749pnz3tp8f_file': error downloading file: error sending request for url
(https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256): client error (Connect): tcp connect error: A
connection attempt failed because the connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to respond. (os error 10060) |
koushiro
reviewed
Mar 24, 2026
Comment on lines
914
to
915
| self.interceptor | ||
| .observe(self.labels.clone(), MetricValue::OperationExecuting(-1)); |
Member
There was a problem hiding this comment.
I think we have already done this in the Drop implementation of MetricsWrapper.
Contributor
Author
There was a problem hiding this comment.
I think my changed places don't even reach MetricsWrapper :thinking_face:
Contributor
Author
There was a problem hiding this comment.
My understanding is:
Result::inspect_errreturns aResult, if it indicates an error, we early return (?), soMetricsWrapperis never reached- Code example to play with: https://gist.github.com/rust-play/b6bfa1693cb7fed23a3a3060175480c0
Member
There was a problem hiding this comment.
I misunderstood what you meant, good catch, you're right.
koushiro
approved these changes
Mar 24, 2026
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.
Which issue does this PR close?
Closes #7266
Rationale for this change
If I don't read the code wrongly, I think in certain places we don't decrement the executing operation count on errors.
What changes are included in this PR?
This PR decrements gauge value on these forgotten errors.
I thought about making a RAII object for
observe, but we also haveMetricsWrapperwhich is more or less a RAII wrapper, don't want to complicate things here, but could be a followup issue.Are there any user-facing changes?
No.
AI Usage Statement
Opus 4.6 helped me make the change.