Bump 'sentry-raven' to 3.1.1 to improve grouping of errors #162
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In order to improve Sentry's grouping of errors, we want to make
use of the
backtrace_cleanup_callback
introduced in 3.1.0:getsentry/sentry-ruby#1011
backtrace_cleanup_callback
automatically uses acustomised version of Rails::BacktraceCleaner
if we don't specify our own. It means that for stack traces like:
app/views/welcome/view_error.html.erb in _app_views_welcome_view_error_html_erb__2807287320172182514_65600 at line 1
...these lines get normalised to:
app/views/welcome/view_error.html.erb at line 1
So if the same
ActionView::Template::Error
error happens twice,it will now be grouped instead of erroneously treated as separate
errors.
This behaviour differs from the native
Rails::BacktraceCleaner
,which has 'silencers' that remove any "framework trace" from your
stacktrace, leaving only the "application trace" behind. This
would actually be beneficial for grouping, as Sentry is very
sensitive to stack traces that differ only slightly, which can
happen when a dependency is updated or a Ruby version is upgraded.
We could specify sentry-raven to use the Rails backtrace cleaner like so:
...however, this is not only used for the comparison, but would alter
the stacktrace itself, meaning we lose key diagnostic information.
This isn't a price worth paying for the sake of 'neatness' in our
Sentry groupings.
Trello: https://trello.com/c/NZNjFHWO/2162-5-improve-sentrys-grouping-of-exceptions