Class: Trace::ZipkinSqsSender

Inherits:
ZipkinSenderBase show all
Defined in:
lib/zipkin-tracer/zipkin_sqs_sender.rb

Constant Summary collapse

IP_FORMAT =
:string

Instance Method Summary collapse

Methods inherited from ZipkinSenderBase

#end_span, #skip_flush?, #start_span, #with_new_span

Constructor Details

#initialize(options) ⇒ ZipkinSqsSender

Returns a new instance of ZipkinSqsSender.



29
30
31
32
33
34
35
# File 'lib/zipkin-tracer/zipkin_sqs_sender.rb', line 29

def initialize(options)
  @sqs_options = options[:region] ? { region: options[:region] } : {}
  @queue_name = options[:queue_name]
  @async = options[:async] != false
  SuckerPunch.logger = options[:logger]
  super(options)
end

Instance Method Details

#flush!Object



37
38
39
40
41
42
43
# File 'lib/zipkin-tracer/zipkin_sqs_sender.rb', line 37

def flush!
  if @async
    SqsClient.perform_async(@sqs_options, @queue_name, spans.dup)
  else
    SqsClient.new.perform(@sqs_options, @queue_name, spans)
  end
end