Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized constant when using ActiveSupport::ParameterFilter #2384

Open
jmatsuba opened this issue Aug 21, 2024 · 1 comment
Open

Uninitialized constant when using ActiveSupport::ParameterFilter #2384

jmatsuba opened this issue Aug 21, 2024 · 1 comment
Assignees

Comments

@jmatsuba
Copy link

jmatsuba commented Aug 21, 2024

Issue Description

During a ruby upgrade we have noticed that ActiveSupport::ParameterFilter started coming up as uninitialized during our deployment process. It is reproducible in the test environment on a fresh install of rails app and sentry-ruby and sentry-rails gems. It is a bit weird that the development environment has no issues starting up. We are experiencing this issue in a deployed environment and when running tests locally.

Exception:
/config/initializers/sentry.rb:4:in block in <main>: uninitialized constant ActiveSupport::ParameterFilter (NameError)

Reproduction Steps

  1. fresh rails install (ruby 3.3.4 & rails 7.2)
  2. add gems of sentry-ruby & sentry-rails, and bundle install
  3. add a initializer for sentry
  4. add a ActiveSupport::ParameterFilter (as described in https://docs.sentry.io/platforms/ruby/guides/rails/configuration/filtering/)
  5. rails test

Expected Behavior

rails test to start without exceptions

or

Documentation to be updated with require "active_support/parameter_filter" as part of the required initializer code.

Actual Behavior

Exception:
/config/initializers/sentry.rb:4:in block in <main>: uninitialized constant ActiveSupport::ParameterFilter (NameError)

Ruby Version

3.3.4

SDK Version

sentry-ruby (5.19.0), sentry-rails (5.19.0)

Integration and Its Version

Rails

Sentry Config

Sentry.init do |config|
  config.dsn = 'redacted'

  filter = ActiveSupport::ParameterFilter.new(Rails.application.config.filter_parameters)

  config.before_send = lambda do |event, hint|
    filter.filter(event.to_hash)
  end

  # get breadcrumbs from logs
  config.breadcrumbs_logger = [:active_support_logger, :http_logger]

  # enable tracing
  # we recommend adjusting this value in production
  config.traces_sample_rate = 1.0

  # enable profiling
  # this is relative to traces_sample_rate
  config.profiles_sample_rate = 1.0
end
@sl0thentr0py
Copy link
Member

thx for reporting, I will update the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants