diff --git a/Gemfile b/Gemfile index e4d859b0f..b53c139bd 100644 --- a/Gemfile +++ b/Gemfile @@ -84,6 +84,7 @@ gem 'sassc-rails' # Use SCSS for stylesheets gem 'sentry-delayed_job' gem 'sentry-rails' gem 'sentry-ruby' +gem 'sentry-sidekiq' gem 'sib-api-v3-sdk' gem 'sidekiq' gem 'skylight' diff --git a/Gemfile.lock b/Gemfile.lock index a85c7926b..0bd3fe815 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -397,7 +397,7 @@ GEM railties (>= 4) request_store (~> 1.0) logstash-event (1.2.02) - loofah (2.21.4) + loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -444,7 +444,7 @@ GEM net-protocol netrc (0.11.0) nio4r (2.5.9) - nokogiri (1.15.4) + nokogiri (1.15.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) open4 (1.3.4) @@ -497,7 +497,7 @@ GEM pundit (2.2.0) activesupport (>= 3.0.0) raabro (1.4.0) - racc (1.7.1) + racc (1.7.3) rack (2.2.8) rack-attack (6.5.0) rack (>= 1.0, < 3) @@ -559,7 +559,7 @@ GEM thor (~> 1.0) zeitwerk (~> 2.5) rainbow (3.1.1) - rake (13.0.6) + rake (13.1.0) rake-progressbar (0.0.5) rb-fsevent (0.11.2) rb-inotify (0.10.1) @@ -682,6 +682,9 @@ GEM sentry-ruby (~> 5.9.0) sentry-ruby (5.9.0) concurrent-ruby (~> 1.0, >= 1.0.2) + sentry-sidekiq (5.9.0) + sentry-ruby (~> 5.9.0) + sidekiq (>= 3.0) shoulda-matchers (4.5.1) activesupport (>= 4.2.0) sib-api-v3-sdk (7.4.0) @@ -921,6 +924,7 @@ DEPENDENCIES sentry-delayed_job sentry-rails sentry-ruby + sentry-sidekiq shoulda-matchers sib-api-v3-sdk sidekiq diff --git a/app/jobs/sidekiq_again_job.rb b/app/jobs/sidekiq_again_job.rb index 1f5b5085e..d819ed936 100644 --- a/app/jobs/sidekiq_again_job.rb +++ b/app/jobs/sidekiq_again_job.rb @@ -2,7 +2,11 @@ class SidekiqAgainJob < ApplicationJob self.queue_adapter = :sidekiq queue_as :default - def perform(user) + def perform(user, with_exception: false) + if with_exception + raise 'Nop' + end + Sentry.capture_message('this is a message from sidekiq') UserMailer.new_account_warning(user).deliver_now end end diff --git a/config/application.rb b/config/application.rb index 151e2b29c..458579197 100644 --- a/config/application.rb +++ b/config/application.rb @@ -80,7 +80,7 @@ module TPS config.ds_zonage_enabled = ENV.fetch("ZONAGE_ENABLED", nil) == "enabled" - config.skylight.probes += [:graphql] + config.skylight.probes += [:graphql, :active_job] # Custom Configuration # @see https://guides.rubyonrails.org/configuring.html#custom-configuration