9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/agent/server/instrument/sidekiq_client.rb', line 9
def call(worker, msg, queue, *_)
tracker = nil
result = nil
begin
jobName = msg["class"]
tracker = ManageEngine::Tracker::DefaultTracker.new("Sidekiq - " + msg["class"] + " - Job Id: " + msg["jid"])
tracker = ManageEngine::Agent::TrackerHandler.invokeTracker(tracker)
rescue Exception=>e
ManageEngine::APMObjectHolder.instance.log.info "Exception while creating tracker for sidekiq_client #{e}"
end
begin
result = yield
rescue Exception=>e
if (tracker != nil)
tracker.setError(e)
end
raise e
ensure
if tracker != nil
tracker.finish
ManageEngine::Agent::TrackerHandler.exitTracker(tracker)
end
end
result
end
|