Class: Hutch::Tracers::Opbeat

Inherits:
Object
  • Object
show all
Defined in:
lib/hutch/tracers/opbeat.rb

Overview

Tracer for Opbeat, which traces each message processed.

Constant Summary collapse

KIND =
'messaging.hutch'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ Opbeat

Returns a new instance of Opbeat.

Parameters:

  • klass (Consumer)

    Consumer instance (!)



10
11
12
# File 'lib/hutch/tracers/opbeat.rb', line 10

def initialize(klass)
  @klass = klass
end

Instance Method Details

#handle(message) ⇒ Object

Parameters:



15
16
17
18
19
# File 'lib/hutch/tracers/opbeat.rb', line 15

def handle(message)
  ::Opbeat.transaction(sig, KIND, extra: extra_from(message)) do
    @klass.process(message)
  end.done(true)
end