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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- Add support for ActiveRecord binds in the log events ([#2761](https://github.com/getsentry/sentry-ruby/pull/2761))

### Bug Fixes

- Guard log subscribers with initialized check ([#2765](https://github.com/getsentry/sentry-ruby/pull/2765))

## 6.0.0

### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class ActionControllerSubscriber < Sentry::Rails::LogSubscriber
#
# @param event [ActiveSupport::Notifications::Event] The controller action event
def process_action(event)
return unless Sentry.initialized?

payload = event.payload

controller = payload[:controller]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class ActionMailerSubscriber < Sentry::Rails::LogSubscriber
#
# @param event [ActiveSupport::Notifications::Event] The email delivery event
def deliver(event)
return unless Sentry.initialized?

payload = event.payload

mailer = payload[:mailer]
Expand Down Expand Up @@ -57,6 +59,8 @@ def deliver(event)
#
# @param event [ActiveSupport::Notifications::Event] The email processing event
def process(event)
return unless Sentry.initialized?

payload = event.payload

mailer = payload[:mailer]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class ActiveJobSubscriber < Sentry::Rails::LogSubscriber
#
# @param event [ActiveSupport::Notifications::Event] The job performance event
def perform(event)
return unless Sentry.initialized?

job = event.payload[:job]
duration = duration_ms(event)

Expand Down Expand Up @@ -63,6 +65,8 @@ def perform(event)
#
# @param event [ActiveSupport::Notifications::Event] The job enqueue event
def enqueue(event)
return unless Sentry.initialized?

job = event.payload[:job]

attributes = {
Expand All @@ -89,6 +93,8 @@ def enqueue(event)
end

def retry_stopped(event)
return unless Sentry.initialized?

job = event.payload[:job]
error = event.payload[:error]

Expand All @@ -111,6 +117,8 @@ def retry_stopped(event)
end

def discard(event)
return unless Sentry.initialized?

job = event.payload[:job]
error = event.payload[:error]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ActiveRecordSubscriber < Sentry::Rails::LogSubscriber
#
# @param event [ActiveSupport::Notifications::Event] The SQL event
def sql(event)
return unless Sentry.initialized?
return if EXCLUDED_NAMES.include?(event.payload[:name])

sql = event.payload[:sql]
Expand Down
Loading