module OpenTelemetry::Instrumentation::Bunny::Patches::Channel
The Channel
module contains the instrumentation patch the Channel#basic_get
, Channel#basic_publish
and Channel#handle_frameset
methods
Public Instance Methods
basic_get(queue, opts = { manual_ack: false })
click to toggle source
Calls superclass method
# File lib/opentelemetry/instrumentation/bunny/patches/channel.rb, line 13 def basic_get(queue, opts = { manual_ack: false }) attributes = OpenTelemetry::Instrumentation::Bunny::PatchHelpers.basic_attributes(self, connection, '', nil) tracer.in_span("#{queue} receive", attributes: attributes, kind: :consumer) do |span, _ctx| delivery_info, properties, payload = super return [delivery_info, properties, payload] unless delivery_info OpenTelemetry::Instrumentation::Bunny::PatchHelpers.trace_enrich_receive_span(span, self, delivery_info, properties) [delivery_info, properties, payload] end end
basic_publish(payload, exchange, routing_key, opts = {})
click to toggle source
Calls superclass method
# File lib/opentelemetry/instrumentation/bunny/patches/channel.rb, line 27 def basic_publish(payload, exchange, routing_key, opts = {}) OpenTelemetry::Instrumentation::Bunny::PatchHelpers.with_send_span(self, tracer, exchange, routing_key) do OpenTelemetry::Instrumentation::Bunny::PatchHelpers.inject_context_into_property(opts, :headers) super(payload, exchange, routing_key, opts) end end
handle_frameset(basic_deliver, properties, content)
click to toggle source
This method is called when rabbitmq pushes messages to subscribed consumers
Calls superclass method
# File lib/opentelemetry/instrumentation/bunny/patches/channel.rb, line 36 def handle_frameset(basic_deliver, properties, content) OpenTelemetry::Instrumentation::Bunny::PatchHelpers.trace_enrich_receive_span(OpenTelemetry::Trace.current_span, self, basic_deliver, properties) if basic_deliver super end
Private Instance Methods
tracer()
click to toggle source
# File lib/opentelemetry/instrumentation/bunny/patches/channel.rb, line 44 def tracer Bunny::Instrumentation.instance.tracer end