Class: Trace::ZipkinRabbitMqSender
- Inherits:
-
ZipkinSenderBase
- Object
- ZipkinSenderBase
- Trace::ZipkinRabbitMqSender
- Defined in:
- lib/zipkin-tracer/zipkin_rabbit_mq_sender.rb
Overview
This class sends information to the Zipkin RabbitMQ Collector.
Constant Summary collapse
- IP_FORMAT =
:string
- DEFAULT_EXCHANGE =
''
- DEAFULT_ROUTING_KEY =
'zipkin'
Instance Method Summary collapse
- #flush! ⇒ Object
-
#initialize(options) ⇒ ZipkinRabbitMqSender
constructor
A new instance of ZipkinRabbitMqSender.
Methods inherited from ZipkinSenderBase
#end_span, #skip_flush?, #start_span, #with_new_span
Constructor Details
#initialize(options) ⇒ ZipkinRabbitMqSender
Returns a new instance of ZipkinRabbitMqSender.
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/zipkin-tracer/zipkin_rabbit_mq_sender.rb', line 29 def initialize() connection = [:rabbit_mq_connection] channel = connection.create_channel exchange_name = [:rabbit_mq_exchange] || DEFAULT_EXCHANGE @routing_key = [:rabbit_mq_routing_key] || DEAFULT_ROUTING_KEY @exchange = channel.exchange(exchange_name) @async = [:async] != false SuckerPunch.logger = [:logger] super() end |
Instance Method Details
#flush! ⇒ Object
41 42 43 44 45 46 47 |
# 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 |