I’ve added sentry-rails (6.2.0) and sentry-ruby (6.2.0).
I’ve configured with config/initializers/sentry.rb this way:
Sentry.init do |config|
config.dsn = "REDACTED"
config.breadcrumbs_logger = [:active_support_logger, :http_logger]
config.excluded_exceptions -= ['ActionController::RoutingError', 'ActiveRecord::RecordNotFound', 'AbstractController::ActionNotFound']
config.trace_ignore_status_codes = [(301..303), (305..399)]
config.send_default_pii = true
end
I’ve tested this integration and received some events on the Sentry Dashboard. However I’m struggling to get two things:
- Reports of HTTP 4** errors.
- Getting
Rails.error.report(e)to report exceptions to Sentry.
Based on this documentation: Error Reporting in Rails Applications — Ruby on Rails Guides
I assume that calling Rails.error.report(e) should report exceptions to Sentry.
Does anyone have an experience with Sentry and its integration with Rails?
Am I mis-interpreting the Rails guides regarding use of Rails.error?
Is it possible to get HTTP 400 errors reported to Sentry?