Repository navigation
fix(metrics): count client-disconnect cancellations as success="cancelled" - #6212
Merged
Merged
Conversation
…lled" (#6126) A recall/reflect the client abandoned was dropped from hindsight.operation.total and .duration entirely (#2185), so there was no way to see how often clients gave up or how long they waited first. It is now recorded with success="cancelled": counted like any other operation, with its time-until-cancel in the duration histogram, while success="false" stays a server-failure-only signal.
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.
Closes #6126.
What changes
A recall or reflect cancelled because the client disconnected used to be dropped from the operation metrics (#2185, #5955). That stopped it inflating the failure rate, but it also made it invisible: no way to see how often clients give up, or after how long.
Now it is recorded like any other operation, with
success="cancelled":hindsight_operation_operations_total{success="cancelled"}counts client hang-ups.hindsight_operation_duration{success="cancelled"}shows how long the request ran before the client cut it — makes too-short client timeouts visible from metrics.success="false"still means a server-side failure only, so failure-rate alerts are unaffected.successnow include cancellations.An unrelated 499 (no
OperationCancelledErrorin its cause chain) is still a failure.Tests
tests/test_metrics.py: the two exclusion tests now assert both cancel paths (bareOperationCancelledErrorandHTTPException(499) fromit) recordsuccess="cancelled"on the counter and the histogram.