Class: Rabbitek::Server::Hooks::OpenTracing

Inherits:
Rabbitek::ServerHook show all
Defined in:
lib/rabbitek/server/hooks/opentracing.rb

Overview

OpenTracing server hook

Instance Method Summary collapse

Instance Method Details

#call(consumer, message) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/rabbitek/server/hooks/opentracing.rb', line 11

def call(consumer, message)
  response = nil

  ::OpenTracing.start_active_span(
    message.delivery_info.routing_key, opts(message.delivery_info, message.properties)
  ) do |scope|
    response = super
  rescue StandardError => e
    Utils::OpenTracing.log_error(scope.span, e)
    raise
  end

  response
end