Skip to content

Sentry reports traces and errors even if enabled_environments is empty #2611

Open
@richardboehme

Description

@richardboehme

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

Metadata

Metadata

Assignees

Type

No type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions