go-grpc-middleware
go-grpc-middleware copied to clipboard
[grpc_zap] Payload error message
Hello, when i add to my GRPC server line:
grpc_zap.PayloadUnaryServerInterceptor(logger, alwaysLoggingDeciderServer),
I see not complete log,I see incoming requests, responses, but i didn't see payload
I take
alwaysLoggingDeciderServerfrom go-grpc-middleware tests folder.
alwaysLoggingDeciderServer := func(ctx context.Context, fullMethodName string, servingObject interface{}) bool {
return true
}
{"level":"info","ts":1626187747.4904773,"caller":"zap/payload_interceptors.go:131","msg":"server response payload logged as grpc.response.content field","system":"grpc","span.kind":"server","grpc.service":"api.SimpleService","grpc.method":"DebugParse","grpc.response.content":{},"grpc.response.contentError":"json: error calling MarshalJSON for type *grpc_zap.jsonpbObjectMarshaler: jsonpb serializer failed: proto: not found"}
What i need add to see bodies of requests?
Edit: Actually i see payload for incoming requests, but for response i see this error:
json: error calling MarshalJSON for type *grpc_zap.jsonpbObjectMarshaler: jsonpb serializer failed: proto: not found
Could you try to narrow down what messages are causing this problem? I'm not sure what could be causing that problem, but it looks to me like that error is coming from the jsonpb serializer, which isn't something we maintain in this repo.
Could you try to narrow down what messages are causing this problem? I'm not sure what could be causing that problem, but it looks to me like that error is coming from the jsonpb serializer, which isn't something we maintain in this repo.
This hard to do, because i have only one rpc method, i'm not returning nil, everytime i respond with crawler.CrawlerResponse, and how i understand when debug, sometimes I see information, but, for a small returned response, for example, where only the string {value: 123456} is contained. Could the problem be caused by the fact that I am returning too much data?
args.Encode(true)is a array of bytes.
data := &crawler.CrawlerData{
Data: &any.Any{Value: args.Encode(true)},
}
return &crawler.CrawlerResponse{Data: data, Status: status.CrawlerStatus_OK}, nil
If it's happening intermittently, then I have no idea what could cause it, but it's unlikely to be a problem in our library. Maybe you are returning too much data, yes.
If it's happening intermittently, then I have no idea what could cause it, but it's unlikely to be a problem in our library. Maybe you are returning too much data, yes.
on average, more than 2-3 kb are returned. I'll test this theory and let you know.
Closing as didn't hear from you back. We can always reopen if still valid. Make sure to check v2 branch as well.