-
Notifications
You must be signed in to change notification settings - Fork 214
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
Add new option to server to report crashes/exceptions #377
Comments
Another interesting option was presented to me today. Logger Metadata -- In specific the The change in this case would be, instead of invoke a callback, we could just produce an error log passing the exception as part of the metadata. Eg: def info({:EXIT, pid, {:handle_error, error}} = err, req, state = %{pid: pid}) do
Logger.warning("3. #{inspect(state)} #{inspect(err)}")
error = %RPCError{status: GRPC.Status.unknown(), message: "Internal Server Error"}
req = send_error(req, error, state, :error)
rpc_error = %RPCError{status: GRPC.Status.unknown(), message: "Internal Server Error"}
req = send_error(req, rpc_error, state, :error)
exception = HandlerException.new(req, error.kind, error.stack)
Logger.error("Unexpected error happened", crash_reason: {exception, error.stack})
{:stop, req, state}
end Each issue reporter can implement it's own logger backend and consume this Let me know if one of these captured you guys interest. I can work on them ASAP |
Hello friend. I have a few questions: 1 Can we measure the impact on the library's overall performance when adding these calls? I know that if we failed, what would matter least would be this, but even so, I still think it's relevant to reflect on the possible impact that these calls could have. |
I find this solution cleaner and more interesting. |
|
Once you choose to follow the Logger way, I believe there will be no major impacts. The comments went to your first suggestion |
Is your feature request related to a problem? Please describe.
Hello Team!
Currently at my work, the team face a challenge when comes to the topic of reporting crashes to tools such as Sentry or Bugsnag. Internally we use a fork of this project where we add some implementation details to report crashes from inside
Cowboy.Handler
So, I thought on a proposal where we could introduce something generic and flexible enough so that anyone can use for their own purposes.
My Idea here is to introduce an option to the GRPC Server startup where you can pass a callback to be invoked whenever an exception (or what the maintainers consider an exception worthy to be reported), that callback expects an exception to be provided and internally any implementation can be used.
Describe the solution you'd like
The new option would be passed on the server startup. Eg:
Describe alternatives you've considered
We can alternatively add these report calls on the service level implementations. Such as
Tho, add the report on that level has it's limitations. For example
:cowboy.req
) to add another layer of information about that executionAdditional context
I made a WIP PR to illustrate better the idea, there's some punishment required, but I think I can add more depth to my request. It's on my fork for fow. Good part of the work there I got inspired by @darrenclark
beligante#3
The text was updated successfully, but these errors were encountered: