Sentry reports traces and errors even if enabled_environments is empty
Issue Description
From the documentation and the name of the configuration option enabled_environments I was expecting that setting it to an empty array would disable sentry. Instead it gets enabled in all environments.
I worked around this by wrapping the whole Sentry.init block with my enabled-condition. Is this the expected way to disable sentry globally (for example via an environment variable)?
Reproduction Steps
Configure Sentry with the configuration below. Start the Rails server and visit a page.
Expected Behavior
I expected it to not report in any environment.
Actual Behavior
However as the empty array is the default value of the configuration option, it reports in all environments.
Ruby Version
3.4.3
SDK Version
5.23.0
Integration and Its Version
Rails (5.23.0)
Sentry Config
Sentry.init do |config|
config.dsn = "..."
config.enabled_environments = []
config.breadcrumbs_logger = [:active_support_logger, :http_logger]
config.traces_sample_rate = 1.0
end
right that's kinda confusing, I'll make the default nil instead of an empty array. Thanks for reporting!
will have to do this in the next major since it subtly alters the init api