Module: NewRelic::Agent::Instrumentation::Bunny::Consumer

Includes:
NewRelic::Agent::Instrumentation::Bunny
Included in:
Bunny::Prepend::Consumer
Defined in:
lib/new_relic/agent/instrumentation/bunny/instrumentation.rb

Constant Summary

Constants included from NewRelic::Agent::Instrumentation::Bunny

DEFAULT_NAME, DEFAULT_TYPE, INSTRUMENTATION_NAME, LIBRARY, SLASH

Instance Method Summary collapse

Methods included from NewRelic::Agent::Instrumentation::Bunny

exchange_name, exchange_type

Instance Method Details

#call_with_tracing(*args) ⇒ Object



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/new_relic/agent/instrumentation/bunny/instrumentation.rb', line 138

def call_with_tracing(*args)
  NewRelic::Agent.record_instrumentation_invocation(INSTRUMENTATION_NAME)

  delivery_info, message_properties, _ = args
  queue_name = queue.respond_to?(:name) ? queue.name : queue

  NewRelic::Agent::Messaging.wrap_amqp_consume_transaction(
    library: LIBRARY,
    destination_name: exchange_name(delivery_info.exchange),
    delivery_info: delivery_info,
    message_properties: message_properties,
    exchange_type: exchange_type(delivery_info, channel),
    queue_name: queue_name
  ) do
    yield
  end
end