From 9eb2e13d436cc66bbc6968d233322ab98c30b066 Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Thu, 1 Jul 2021 15:06:14 +0200 Subject: [PATCH] config: report job exceptions after max retry count reached Previously Sentry reported job exceptions even if a retry strategy was specified. So we had to ignore retried job exceptions entirely. Since sentry-delayed-job 0.4.4, we can instead let Sentry report job exceptions when the retry count is exhausted. Which is exactly the behavior we want. --- Gemfile.lock | 4 ++-- config/initializers/sentry.rb | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 98315f70f..eb21c74b0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -170,7 +170,7 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.8) + concurrent-ruby (1.1.9) connection_pool (2.2.3) crack (0.4.5) rexml @@ -244,7 +244,7 @@ GEM execjs (2.7.0) factory_bot (6.1.0) activesupport (>= 5.0.0) - faraday (1.4.2) + faraday (1.4.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index 75bc84ece..442a5f69f 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -7,13 +7,5 @@ Sentry.init do |config| config.enabled_environments = ['production', secrets[:environment].presence].compact 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' - ] + config.delayed_job.report_after_job_retries = true end