Issue Description
- We have some tests checking our filtering before sending data to Sentry.
- When upgrading to 5.22.2 we no longer get any events in our tests
Our filtering matches the documentation
https://docs.sentry.io/platforms/ruby/guides/rails/data-management/sensitive-data/#scrubbing-data
I think this change is the culprit.
Reproduction Steps
config/initializers/sentry.rb
SENTRY_FILTER = %i[
identification_number
...
]
Sentry.init do |config|
# https://docs.sentry.io/platforms/ruby/guides/rails/data-management/sensitive-data/#scrubbing-data
filter = ActiveSupport::ParameterFilter.new(
SENTRY_FILTER
)
config.before_send = lambda do |event, hint|
filter.filter(event.to_hash)
end
end
require "test_helper"
require "sentry/test_helper"
class SentryTest < ActiveSupport::TestCase
include Sentry::TestHelper
setup do
setup_sentry_test
end
test "exception sends to Sentry" do
exception = RuntimeError.new("This is a test")
Sentry.capture_exception(exception)
event = last_sentry_event # this returns nil on 5.22.2
message = event[:exception][:values][0][:value]
assert_match(/This is a test/, message)
end
end
Expected Behavior
before_send filter should still be valid (or another way to write it)
Actual Behavior
before_send returns hash and therefore it will not send
Ruby Version
3.3.7
SDK Version
5.22.2
Integration and Its Version
Rails 7.1, Sidekiq 7.3.8
Sentry Config
Minimal example that reproduces the error
SENTRY_FILTER = %i[
body
identification_number
]
Sentry.init do |config|
# https://docs.sentry.io/platforms/ruby/guides/rails/data-management/sensitive-data/#scrubbing-data
filter = ActiveSupport::ParameterFilter.new(
SENTRY_FILTER
)
config.before_send = lambda do |event, hint|
filter.filter(event.to_hash)
end
end
Issue Description
Our filtering matches the documentation
https://docs.sentry.io/platforms/ruby/guides/rails/data-management/sensitive-data/#scrubbing-data
I think this change is the culprit.
Reproduction Steps
config/initializers/sentry.rb
Expected Behavior
before_sendfilter should still be valid (or another way to write it)Actual Behavior
before_sendreturns hash and therefore it will not sendRuby Version
3.3.7
SDK Version
5.22.2
Integration and Its Version
Rails 7.1, Sidekiq 7.3.8
Sentry Config
Minimal example that reproduces the error