Class: Atatus::Spies::SidekiqSpy::Middleware Private

Inherits:
Object
  • Object
show all
Defined in:
lib/atatus/spies/sidekiq.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#call(_worker, job, queue) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/atatus/spies/sidekiq.rb', line 30

def call(_worker, job, queue)
  name = SidekiqSpy.name_for(job)
  transaction = Atatus.start_transaction(name, 'Sidekiq')
  Atatus.set_label(:queue, queue)

  yield

  transaction&.done :success
  transaction&.outcome = Transaction::Outcome::SUCCESS
rescue ::Exception => e
  Atatus.report(e, handled: false)
  transaction&.done :error
  transaction&.outcome = Transaction::Outcome::FAILURE
  raise
ensure
  Atatus.end_transaction
end