Class: Instana::Activators::SidekiqClient

Inherits:
Instana::Activator show all
Defined in:
lib/instana/activators/sidekiq_client.rb

Instance Method Summary collapse

Methods inherited from Instana::Activator

#call, call, inherited, start

Instance Method Details

#can_instrument?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/instana/activators/sidekiq_client.rb', line 7

def can_instrument?
  defined?(::Sidekiq) && ::Sidekiq.respond_to?(:configure_client) && ::Instana.config[:'sidekiq-client'][:enabled]
end

#instrumentObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/instana/activators/sidekiq_client.rb', line 11

def instrument
  require 'instana/instrumentation/sidekiq-client'

  ::Sidekiq.configure_client do |cfg|
    cfg.client_middleware do |chain|
      chain.add ::Instana::Instrumentation::SidekiqClient
    end
  end

  true
end