bradleyjkemp/grpc-tools

grpc-dump doesn't show error/status details

shinderuk opened this issue · 0 comments

This can be demonstrated with the grpc-go sample code.

  1. Start the sample server
$ go run ./server
  1. Copy helloworld.proto to proto/helloworld/helloworld.proto
  2. Start grpc-dump
$ ~/go/bin/grpc-dump -port 8980 -destination localhost:50052 -proto_roots proto
...
  1. Run the sample client twice:
$ go run ./client --addr localhost:8980
2020/04/01 00:10:48 Greeting: Hello world
$ go run ./client --addr localhost:8980
2020/04/01 00:10:50 Quota failure: violations:<subject:"name:world" description:"Limit one greeting per person" > 
exit status 1
  1. Inspect grpc-dump output:
{"service":"helloworld.Greeter","method":"SayHello","messages":[{"message_origin":"client","raw_message":"CgV3b3JsZA==","message":{"name":"world"},"timestamp":"2020-04-01T00:10:48.645753+03:00"},{"message_origin":"server","raw_message":"CgtIZWxsbyB3b3JsZA==","message":{"message":"Hello world"},"timestamp":"2020-04-01T00:10:48.646446+03:00"}],"metadata":{":authority":["localhost:8980"],"content-type":["application/grpc"],"user-agent":["grpc-go/1.29.0-dev"],"via":["HTTP/2.0 127.0.0.1:8980"]},"metadata_response_headers":{"content-type":["application/grpc"]},"metadata_response_trailers":{}}
{"service":"helloworld.Greeter","method":"SayHello","messages":[{"message_origin":"client","raw_message":"CgV3b3JsZA==","message":{"name":"world"},"timestamp":"2020-04-01T00:10:50.002394+03:00"}],"error":{"code":"ResourceExhausted","message":"Request limit exceeded."},"metadata":{":authority":["localhost:8980"],"content-type":["application/grpc"],"user-agent":["grpc-go/1.29.0-dev"],"via":["HTTP/2.0 127.0.0.1:8980"]},"metadata_response_headers":null,"metadata_response_trailers":{"content-type":["application/grpc"]}}

There are no error details:

{"code":"ResourceExhausted","message":"Request limit exceeded."}

I think, It would be better to add a raw grpc-status-details-bin trailer to the output, at least for replay and debugging.