class Trace::ZipkinRabbitMqSender
This class sends information to the Zipkin RabbitMQ Collector.
Constants
- DEAFULT_ROUTING_KEY
- DEFAULT_EXCHANGE
- IP_FORMAT
Public Class Methods
new(options)
click to toggle source
Calls superclass method
# File lib/zipkin-tracer/zipkin_rabbit_mq_sender.rb, line 29 def initialize(options) connection = options[:rabbit_mq_connection] channel = connection.create_channel exchange_name = options[:rabbit_mq_exchange] || DEFAULT_EXCHANGE @routing_key = options[:rabbit_mq_routing_key] || DEAFULT_ROUTING_KEY @exchange = channel.exchange(exchange_name) @async = options[:async] != false SuckerPunch.logger = options[:logger] super(options) end
Public Instance Methods
flush!()
click to toggle source
# File lib/zipkin-tracer/zipkin_rabbit_mq_sender.rb, line 41 def flush! if @async RabbitMqPublisher.perform_async(@exchange, @routing_key, spans.dup) else RabbitMqPublisher.new.perform(@exchange, @routing_key, spans) end end