grpc icon indicating copy to clipboard operation
grpc copied to clipboard

Make it possible to provide an error handler so that I can report errors to arbitrary observability SaaS's

Open freshtonic opened this issue 4 years ago • 2 comments

Describe the bug

In lib/grpc/server.ex in function do_handle_request if the message fails to decode here codec.decode(message, req_mod) an exception is thrown but there is no way to capture the error besides seeing it in my server logs.

The error is logged via Logger but by that point I no longer had the original error (just a message and a stack trace as text). This is preventing a straightforward integration with my observabilty SaaS who's API requires real error objects.

To Reproduce Steps to reproduce the behavior:

Send a message with the wrong wire type for a field (imagine you've made a backwards incompatible change to your protobuf message).

Expected behavior

I expect to be able to capture arbitrary errors generated by grpc and handle them as I wish.

freshtonic avatar Jun 18 '21 02:06 freshtonic

Here's a PR that implements an "exception sink" configuration option for endpoints.

https://github.com/elixir-grpc/grpc/pull/197

freshtonic avatar Jun 18 '21 05:06 freshtonic

Perhaps this is also related to #229 I guess if you just want to report errors, we should be able to provide sufficient Telemetry events for that

polvalente avatar Jul 19 '22 16:07 polvalente