Skip to content
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

[ 377 ] Add crash_report logger metadata for exceptions captured by Cowboy.Handler #381

Merged
merged 12 commits into from
Jul 11, 2024

Conversation

beligante
Copy link
Contributor

Introduces #377

This change aims to follow the elixir standard to make usage of crash_report metadata as listed here so that users can access these with additional information about the request and connection.

One example of usage for this is the platforms for bug reports such as Sentry or Bugsnag. A user can implement its own logger backend and process the log lines that contains crash_report metadata. Notice that we're normalizing the exceptions based on the elixir docs

One extra thing changed here: Use :proc_lib.start_link which is a erlang module that also adds crash_report to processes

@sleipnir
Copy link
Collaborator

@beligante I only presented one argument in my review. If you can address it I will proceed with approval.

Copy link
Collaborator

@sleipnir sleipnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some suggestions for your enjoyment.
Let me know if you approve. If so, you would need to rename the adapter_exception.ex file

lib/grpc/server/adapters/adapter_exception.ex Outdated Show resolved Hide resolved
lib/grpc/server/adapters/cowboy/handler.ex Outdated Show resolved Hide resolved
lib/grpc/server/adapters/cowboy/handler.ex Outdated Show resolved Hide resolved
lib/grpc/server/adapters/cowboy/handler.ex Outdated Show resolved Hide resolved
lib/grpc/server/adapters/cowboy/handler.ex Outdated Show resolved Hide resolved
lib/grpc/server/adapters/cowboy/handler.ex Outdated Show resolved Hide resolved
@beligante
Copy link
Contributor Author

Yup! Those LGTM!

@sleipnir
Copy link
Collaborator

Yup! Those LGTM!

Just don't forget to rename the adapter_exception.ex to report_exception.ex

@beligante
Copy link
Contributor Author

Yup! Those LGTM!

Just don't forget to rename the adapter_exception.ex to report_exception.ex

Nice catch! I forgot about that detail. Thanks

@sleipnir
Copy link
Collaborator

LGTM @beligante

@sleipnir sleipnir merged commit dce082c into elixir-grpc:master Jul 11, 2024
8 checks passed
@beligante beligante deleted the add-crash-report-to-error-log branch July 12, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants