Skip to content
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

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

kexiongliu123
Copy link

Fix span error tagging in GO YARPC/http

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

transport/http/handler.go Outdated Show resolved Hide resolved
transport/http/handler.go Outdated Show resolved Hide resolved
transport/http/outbound.go Show resolved Hide resolved
transport/http/outbound.go Outdated Show resolved Hide resolved
@ChenX1993
Copy link
Contributor

Can we add error tag when the http status code indicates the error? e.g. where the getYARPCErrorFromResponse is called in outbound.go

@@ -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())
Copy link
Collaborator

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?

Copy link
Collaborator

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?

transport/http/outbound.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants