Raven Ruby v3.1.0 Release Notes
Release Date: 2020-09-17 // over 3 years ago-
๐ Feature
๐ Exclude all 4xx Rails errors (#1004)
See the full list here
Add some error context in
transport_failure_callback
(#1003)Before:
config.transport_failure_callback = lambda { |event| AdminMailer.email_admins("Oh god, it's on fire!", event).deliver_later }
After:
config.transport_failure_callback = lambda { |event, error| AdminMailer.email_admins("Oh god, it's on fire because #{error.message}!", event).deliver_later }
๐ Support cleaning up exception backtrace with customized backtrace_cleaner (#1011)
The new config
backtrace_cleanup_callback
takes a lambda/proc object (default isnil
) and will be called with exception's backtraceRaven.configure do |config| config.backtrace_cleanup_callback = lambda do |backtrace| Rails.backtrace_cleaner.clean(backtrace) end end
And with the Rails integration, it'll automatically use a customized
Raven::Rails::BacktraceCleaner
to clean up exception's backtrace. It's basically Rails 6's backtrace cleaner but without silencers.The main reason to add this cleaner is to remove template methods from the trace, e.g.
app/views/welcome/view_error.html.erb in _app_views_welcome_view_error_html_erb__2807287320172182514_65600 at line 1
will become
app/views/welcome/view_error.html.erb at line 1
This can help Sentry group issues more accurately. See #957 for more information about this.
If you don't want this change, you can disable it with:
Raven.configure do |config| config.backtrace_cleanup_callback = nil end
๐ Make dsn value accessable from config (#1012)
You can now access the dsn value via
Raven.configuration.dsn
๐ Deprecation
๐ Deprecate dasherized filenames (#1006)
If you're using
gem 'sentry-raven', require: 'sentry-raven-without-integrations' # or require "sentry-raven-without-integrations"
you will start seeing deprecation warnings. Please change them into
gem 'sentry-raven', require: 'sentry_raven_without_integrations' # or require "sentry_raven_without_integrations"
๐ Unify breadcrumb loggers activation (#1016)
Currently, we activate our breadcrumb loggers differently:
require "raven/breadcrumbs/sentry_logger" Raven.configuration.rails_activesupport_breadcrumbs = true
It's not a nice user interface, so this PR adds a new configuration option
breadcrumbs_logger
to improve this:Raven.configuration.breadcrumbs_logger = :sentry_logger Raven.configuration.breadcrumbs_logger = :active_support_logger Raven.configuration.breadcrumbs_logger = [:sentry_logger, :active_support_logger]
Please migrate to the new activation apporach, otherwise you'll see depraction warnings. And old ones will be dropped in version 4.0.
๐จ Refactor
- ๐ Accept non-string message in Event.from_exception (#1005)
- ๐จ Refactor event initialization (#1010)
- ๐จ Refactor sidekiq integration (#1019)
๐ Fix