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

Make backtrace cleaning optional #242

Closed

Conversation

chancancode
Copy link

Hello!

This is a starting point to fix #228. It adds a new config clean_backtrace (defaults to true) for changing whether backtraces should be cleaned.

Also fixed a bug where the backtrace of background exceptions are not ran through the backtrace cleaner currently – I'm unsure if this was intentional, but it was easier to "fix" this so that the test would pass. If that's unacceptable, feel free to pick it up from here and improve the code.

To maintain the current behavior, the new option is defaulted to true. However, personally, I feel that this whole feature (backtrace cleaning) is of dubious values in these exception emails. I came across this when helping a client debug an error they are encountering, but unfortunately the error is originated from a gem so I didn't have any backtrace to look at. It seems like you would always want to have more information in these reports... I'm not sure if there's much value in having the option to clean the backtrace in the first place in this context.

The backtrace cleaning code is also only used in the EmailNotifier, so if this is staying, it should probably be moved up one layer so that it would be consistent across the WebhookNotifier (for example) and the chat notifiers as well (in theory, the cleaner could remove some of the top frames in the backtrace as well).

Like I said, this is only a starting point, so if it doesn't fit your needs for some reason, feel free to pick it up and improve it or reimplement in another way. Would love to see this feature go into the master branch eventually!

Thanks for reviewing this, hope it helps! ❤️ 💛 💚 💙 💜

Fixes #228

This adds a new config `config.exception_notification.clean_backtrace` (defaults
to `true`) for changing whether backtraces should be cleaned.

Also fixed a bug where the backtrace of background exceptions are not ran
through the backtrace cleaner currently.

Fixes smartinez87#228
@coveralls
Copy link

Coverage Status

Coverage increased (+0.24%) when pulling 43fe0dd on chancancode:optional_backtrace_cleaning into f5dd6eb on smartinez87:master.

@chancancode
Copy link
Author

(Travis failure seems unrelated, #237 had the same problem. Seems like we just need to lock down the sidekiq version on the older Gemfiles)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.25%) when pulling 110241d on chancancode:optional_backtrace_cleaning into f5dd6eb on smartinez87:master.

@chancancode
Copy link
Author

@rywall @tejanium @cmassimo you might want to give this a try in your app and see if it needs any more refinement 😄

@vala
Copy link

vala commented Jun 9, 2015

Any chance that this can be merged at some point ?

@smartinez87
Copy link
Owner

@vala are you still experiencing problems with the backtrace?

@rojosinalma
Copy link

+1

Having this would be very nice, right now (specially with Sidekiq) I get very little info and would really like to have the full backtrace sometimes.

@luis-luna-aguilar
Copy link

+1 the full stack trace would save you some time of log digging when you need more info.

@vala
Copy link

vala commented Aug 21, 2015

@smartinez87 Sorry for the delay, but the backtrace is still cleaned up in the latest versions of Exception Notification for me

@smartinez87
Copy link
Owner

closing this PR in favor of #328

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.

Option to skip backtrace cleaning?
6 participants