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

net/gclient: gclient downloads pictures, causing observable reporting. The tracingEventHttpResponseBody body is not utf8, causing tracking loss. #3791

Closed
ivothgle opened this issue Sep 23, 2024 · 1 comment · Fixed by #3810
Assignees
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. done This issue is done, which may be release in next version.

Comments

@ivothgle
Copy link
Contributor

ivothgle commented Sep 23, 2024

Go version

1.22

GoFrame version

2.7.0

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

开启链路跟踪

g.Client().GetBytes(ctx, "http://a.com/jpg")

然后就报 string field contains invalid UTF-8 了

主要原因是这里获取到了非文本内容导致的

resBodyContent, err := gtrace.SafeContentForHttp(reqBodyContentBytes, response.Header)
if err != nil {
    span.SetStatus(codes.Error, fmt.Sprintf(`converting safe content failed: %s`, err.Error()))
}

What did you see happen?

希望可以提供自定义修改或忽略

What did you expect to see?

然后就报 string field contains invalid UTF-8 了

@ivothgle ivothgle added the bug It is confirmed a bug, but don't worry, we'll handle it. label Sep 23, 2024
@Issues-translate-bot Issues-translate-bot changed the title net/gclient: gclient 下载图片导致可观测上报 tracingEventHttpResponseBody body 是非 utf8 导致跟踪丢失 net/gclient: gclient downloads pictures, causing observable reporting. The tracingEventHttpResponseBody body is not utf8, causing tracking loss. Sep 23, 2024
@gqcn gqcn self-assigned this Sep 25, 2024
@gqcn
Copy link
Member

gqcn commented Sep 25, 2024

@ivothgle Thanks for you feedback, I'll have a check for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. done This issue is done, which may be release in next version.
Projects
None yet
2 participants