Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Returning a hash from `before_send` and `before_send_transaction` is no longer supported and will drop the event.
- Remove stacktrace trimming ([#2714](https://github.com/getsentry/sentry-ruby/pull/2714))
- `config.enabled_environments` now defaults to `nil` instead of `[]` for sending to all environments ([#2716](https://github.com/getsentry/sentry-ruby/pull/2716))
- Remove `:monotonic_active_support_logger` from `config.breadcrumbs_logger` ([#2717](https://github.com/getsentry/sentry-ruby/pull/2717))

### Internal

Expand Down

This file was deleted.

11 changes: 3 additions & 8 deletions sentry-rails/lib/sentry/rails/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,12 @@ def patch_background_worker
end

def inject_breadcrumbs_logger
if Sentry.configuration.breadcrumbs_logger.include?(:active_support_logger)
if Sentry.configuration.breadcrumbs_logger.include?(:active_support_logger) ||
## legacy name redirected for backwards compat
Sentry.configuration.breadcrumbs_logger.include?(:monotonic_active_support_logger)
require "sentry/rails/breadcrumb/active_support_logger"
Sentry::Rails::Breadcrumb::ActiveSupportLogger.inject(Sentry.configuration.rails.active_support_logger_subscription_items)
end

if Sentry.configuration.breadcrumbs_logger.include?(:monotonic_active_support_logger)
return warn "Usage of `monotonic_active_support_logger` require a version of Rails >= 6.1, please upgrade your Rails version or use another logger" if ::Rails.version.to_f < 6.1

require "sentry/rails/breadcrumb/monotonic_active_support_logger"
Sentry::Rails::Breadcrumb::MonotonicActiveSupportLogger.inject
end
end

def setup_backtrace_cleanup_callback
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,33 @@
end
end

context "redirects legacy :monotonic_active_support_logger" do
before do
make_basic_app do |sentry_config|
sentry_config.breadcrumbs_logger = [:monotonic_active_support_logger]
end
end

it "captures correct data of exception requests" do
get "/exception"

expect(response.status).to eq(500)
breadcrumbs = event.dig("breadcrumbs", "values")
expect(breadcrumbs.count).to eq(2)

breadcrumb = breadcrumbs.detect { |b| b["category"] == "process_action.action_controller" }
expect(breadcrumb["data"]).to include(
{
"controller" => "HelloController",
"action" => "exception",
"params" => { "controller" => "hello", "action" => "exception" },
"format" => "html",
"method" => "GET", "path" => "/exception"
}
)
end
end

context "with tracing" do
before do
make_basic_app do |sentry_config|
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion sentry-ruby/lib/sentry/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ class Configuration
#
# And if you also use sentry-rails:
# - :active_support_logger
# - :monotonic_active_support_logger
#
# @return [Array<Symbol>]
attr_reader :breadcrumbs_logger
Expand Down
Loading