Improve handling of canceled calls in logging, metrics and tracing.#180
Merged
Improve handling of canceled calls in logging, metrics and tracing.#180
Conversation
94dc153 to
8222cc1
Compare
thorfour
approved these changes
Feb 26, 2020
|
|
||
| // IsCanceled checks whether an error comes from an operation being canceled | ||
| func IsCanceled(err error) bool { | ||
| if err == context.Canceled { |
Collaborator
Author
There was a problem hiding this comment.
That would force consumers to upgrade to Go 1.13, I think.
Which is not a bad idea, but more work than I want to complete before merging this.
Do you want to file it as an issue/enhancement?
There was a problem hiding this comment.
That's a good consideration. I can file it as an enhancement
2 tasks
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.
Replacement for #159, including testing.
The visible improvement is that gRPC streaming functions no longer cause a log message when canceled by the caller.
Canceled functions of all kinds no longer show as an error in tracing.
Also note that canceled gRPC functions will now show up in metrics under the label
cancelrather thanerror.There are a lot of diffs from the re-generation of a protobuf file, which I separated to its own commit.