Skip to content

Sending to sentry is always enabled when using spotlight #2226

@william-stacken

Description

@william-stacken

Issue Description

When enabling spotlight, the sentry configuration permits sending events to sentry through sending_allowed? regardless of enabled_environments.
https://github.com/getsentry/sentry-ruby/blob/5.15.0/sentry-ruby/lib/sentry/configuration.rb#L463

Not setting the dsn did not work as a workaround, since sending_allowed? also requires a valid DSN before SpotlightTransport.send_data is invoked.

Reproduction Steps

Set config.spotlight to true, config.dsn to a valid DSN, and do not include config.environment in config.enabled_environments. Trigger an event to be sent threough for example raise 'test'.

Expected Behavior

Events are sent to the spotlight sidecar only, not sentry

Actual Behavior

Events are sent to both of them

Ruby Version

3.2.2

SDK Version

5.15

Integration and Its Version

Rails 7.0.5.1, sidekiq 6.1

Sentry Config

Sentry.init do |config|

Enable Sentry in production and conditionally in development

config.environment = 'development'
config.enabled_environments = ['production']

config.dsn = DSN

config.spotlight = true
end

Metadata

Metadata

Assignees

Labels

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions