-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix span error tagging in GO YARPC/http #2285
base: dev
Are you sure you want to change the base?
Conversation
|
Can we add error tag when the http status code indicates the error? e.g. where the |
transport/http/outbound.go
Outdated
@@ -524,6 +523,9 @@ func getYARPCErrorFromResponse(tres *transport.Response, response *http.Response | |||
).WithDetails(details) | |||
|
|||
if bothResponseError { | |||
if response.StatusCode >= 400 { | |||
UpdateSpanWithErrAndCode(span, yarpcErr, yarpcerrors.FromError(yarpcErr).Code()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have "code" var here, why do we need to get it via creating new error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we even need it, if UpdateSpanWithErrAndCode already was called unconditionally at transport/http/outbound.go::317?
Fix span error tagging in GO YARPC/http