Issue Description
On server startup, when Sentry configuration may not be fully initialized, it seems that there are spots where Sentry.configuration may be nil.
This is very similar to other previous issues I've encountered around Sentry.configuration initialization: #2782 #2386
We should generally guard against non-initialized Sentry.configuration calls by ensuring that Sentry is initialized.
Currently, the method just exits early https://github.com/getsentry/sentry-ruby/blob/e219832b57c5aa32e41be4462dbe421c8c58bc67/sentry-ruby/lib/sentry-ruby.rb#L164C1-L167C8
Could it be changed such that if we are not initialized, we actually initialize Sentry? I feel this would prevent a whole class of NoMethod no nil errors I've personally run into.
Reproduction Steps
During app boot (after a new deploy for example), we occasionally run into this type of error.
Expected Behavior
Sentry does not cause a 500.
Actual Behavior
Sentry causes a 500 with no backtrace.
Ruby Version
3.4.4
SDK Version
6.1.1
Integration and Its Version
Rails 8.0.2
Sentry Config
Default
Issue Description
On server startup, when Sentry configuration may not be fully initialized, it seems that there are spots where
Sentry.configurationmay benil.This is very similar to other previous issues I've encountered around
Sentry.configurationinitialization: #2782 #2386We should generally guard against non-initialized
Sentry.configurationcalls by ensuring that Sentry is initialized.Currently, the method just exits early https://github.com/getsentry/sentry-ruby/blob/e219832b57c5aa32e41be4462dbe421c8c58bc67/sentry-ruby/lib/sentry-ruby.rb#L164C1-L167C8
Could it be changed such that if we are not initialized, we actually initialize Sentry? I feel this would prevent a whole class of
NoMethod no nilerrors I've personally run into.Reproduction Steps
During app boot (after a new deploy for example), we occasionally run into this type of error.
Expected Behavior
Sentry does not cause a 500.
Actual Behavior
Sentry causes a 500 with no backtrace.
Ruby Version
3.4.4
SDK Version
6.1.1
Integration and Its Version
Rails 8.0.2
Sentry Config
Default