You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. What version of Go and system type/arch are you using?
go 1.19, linux/amd64
2. What version of GoFrame are you using?
goframe version v2.2.2
3. Can this issue be re-produced with the latest release?
yes, can re-produced in the latest release, v2.5.0
4. What did you do?
when use goframe server, handle the /metrics to send trace infomation to the otel-collector, it will change to grpc protocol,but will get 'invalid utf-8' error.
the reason is that, when handle to '/metrics', if not set DisableCompress to true, and the header in the request contains 'Account-Encoding: gzip', the response will be gziped. you can see the code in : https://github.com/prometheus/client_golang/blob/main/prometheus/promhttp/http.go#L172.
And in goframe server middleware, it will set the attribute "http.response.body" with the value of response, but now the response is now gziped, it will not be valid utf-8 string.
So when send traces by grpc in https://github.com/protocolbuffers/protobuf-go/blob/master/internal/impl/codec_gen.go#L5028, it will return "invalid utf-8" error.
prometheus server like this:
maybe in goframe, when add attribute in the server middleware, need to check the header contains 'gzip' or not , if contains, the response should be ungzip, and then set the ungziped string to the attribute.
The text was updated successfully, but these errors were encountered:
Hello @ltp217. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!
你好 @ltp217。我们喜欢您的提案/反馈,并希望您或其他社区成员通过拉取请求做出贡献。我们提前感谢您的贡献,并期待对其进行审查。
1. What version of
Go
and system type/arch are you using?go 1.19, linux/amd64
2. What version of
GoFrame
are you using?goframe version v2.2.2
3. Can this issue be re-produced with the latest release?
yes, can re-produced in the latest release, v2.5.0
4. What did you do?
when use goframe server, handle the /metrics to send trace infomation to the otel-collector, it will change to grpc protocol,but will get 'invalid utf-8' error.
the reason is that, when handle to '/metrics', if not set DisableCompress to true, and the header in the request contains 'Account-Encoding: gzip', the response will be gziped. you can see the code in :
https://github.com/prometheus/client_golang/blob/main/prometheus/promhttp/http.go#L172.
And in goframe server middleware, it will set the attribute "http.response.body" with the value of response, but now the response is now gziped, it will not be valid utf-8 string.
So when send traces by grpc in https://github.com/protocolbuffers/protobuf-go/blob/master/internal/impl/codec_gen.go#L5028, it will return "invalid utf-8" error.
prometheus server like this:
before the promhttp.HandlerOpts don't contains 'DisableCompression: true'
and use the otel by grpc protocol, can see:https://github.com/open-telemetry/opentelemetry-go/tree/main/example/otel-collector.
5. What did you expect to see?
maybe in goframe, when add attribute in the server middleware, need to check the header contains 'gzip' or not , if contains, the response should be ungzip, and then set the ungziped string to the attribute.
The text was updated successfully, but these errors were encountered: