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



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/new_relic/agent/instrumentation/bunny/instrumentation.rb', line 152

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