diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index 257311c91..5c9c3d74d 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -1,7 +1,8 @@ Sentry.init do |config| config.dsn = ENV['SENTRY_ENABLED'] == 'enabled' ? ENV['SENTRY_DSN_RAILS'] : nil config.send_default_pii = false - config.enabled_environments = ['production'] + config.environment = ENV.fetch('SENTRY_ENVIRONMENT', Rails.env) + config.enabled_environments = ['production', ENV['SENTRY_ENVIRONMENT'].presence].compact config.breadcrumbs_logger = [:active_support_logger] config.traces_sample_rate = ENV['SENTRY_ENABLED'] == 'enabled' ? 0.001 : nil config.excluded_exceptions += [