demarches-normaliennes/config/initializers/sentry.rb

20 lines
813 B
Ruby
Raw Normal View History

2021-01-28 14:49:03 +01:00
Sentry.init do |config|
secrets = Rails.application.secrets.sentry
config.dsn = secrets[:enabled] ? secrets[:rails_client_key] : nil
2021-01-28 14:49:03 +01:00
config.send_default_pii = false
config.environment = secrets[:environment] || Rails.env
config.enabled_environments = ['production', secrets[:environment].presence].compact
2021-01-28 14:49:03 +01:00
config.breadcrumbs_logger = [:active_support_logger]
config.traces_sample_rate = secrets[:enabled] ? 0.001 : nil
config.excluded_exceptions += [
# Ignore exceptions caught by ActiveJob.retry_on
# https://github.com/getsentry/sentry-ruby/issues/1347
'Excon::Error::BadRequest',
'ActiveStorage::IntegrityError',
'VirusScannerJob::FileNotAnalyzedYetError',
'TitreIdentiteWatermarkJob::WatermarkFileNotScannedYetError',
'APIEntreprise::API::Error::TimedOut'
]
2021-01-28 14:49:03 +01:00
end