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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

## TBD

### Enhancements

* Use `ActiveSupport::Notifications.monotonic_subscribe` for performance improvement on compatible Rails versions
| [#856](https://github.com/bugsnag/bugsnag-ruby/pull/856)

## v6.29.0 (21 January 2026)

### Enhancements
Expand Down
4 changes: 3 additions & 1 deletion lib/bugsnag/integrations/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class Railtie < ::Rails::Railtie
# @api private
# @param event [Hash] details of the event to subscribe to
def event_subscription(event)
ActiveSupport::Notifications.subscribe(event[:id]) do |*, event_id, data|
# monotonic_subscribe was introduced in Rails 6.1+, check if it exists
subscription_method = ActiveSupport::Notifications.respond_to?(:monotonic_subscribe) ? :monotonic_subscribe : :subscribe
ActiveSupport::Notifications.send(subscription_method, event[:id]) do |*, event_id, data|
Comment thread
SB-khushbum marked this conversation as resolved.
filtered_data = data.slice(*event[:allowed_data])
filtered_data[:event_name] = event[:id]
filtered_data[:event_id] = event_id
Expand Down
Loading