Sha256: 16688eac0a8e79b65196165fed23bbb2f6047d3f966e18770ea2b4deff9a89f3
Contents?: true
Size: 880 Bytes
Versions: 15
Compression:
Stored size: 880 Bytes
Contents
# (c) Copyright IBM Corp. 2021 # (c) Copyright Instana Inc. 2021 module Instana module Activators class ResqueWorker < Activator def can_instrument? defined?(::Resque::Worker) && defined?(::Resque::Job) && ::Instana.config[:'resque-worker'][:enabled] end def instrument require 'instana/instrumentation/resque' ::Resque::Worker.prepend(::Instana::Instrumentation::ResqueWorker) ::Resque::Job.prepend(::Instana::Instrumentation::ResqueJob) ::Resque.before_fork do |_job| ::Instana.agent.before_resque_fork end ::Resque.after_fork do |_job| ::Instana.agent.after_resque_fork end # Set this so we assure that any remaining collected traces are reported at_exit ENV['RUN_AT_EXIT_HOOKS'] = "1" true end end end end
Version data entries
15 entries across 15 versions & 1 rubygems