Merge pull request #9730 from demarches-simplifiees/polish_sidekiq

Tech: rajoute des logs, de l'audit de perf et du suivi de bug pour la file de job asynchrone sidekiq
This commit is contained in:
LeSim 2023-11-23 10:15:37 +00:00 committed by GitHub
commit f66a32c316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 6 deletions

View file

@ -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'

View file

@ -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

View file

@ -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

View file

@ -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