Class: Trace::ZipkinHttpSender

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

Overview

This class sends information to the Zipkin API. The API accepts a JSON representation of a list of spans

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) ⇒ ZipkinHttpSender

Returns a new instance of ZipkinHttpSender.



34
35
36
37
38
39
# File 'lib/zipkin-tracer/zipkin_http_sender.rb', line 34

def initialize(options)
  @json_api_host = options[:json_api_host]
  @async = options[:async] != false
  SuckerPunch.logger = options[:logger]
  super(options)
end

Instance Method Details

#flush!Object



41
42
43
44
45
46
47
# File 'lib/zipkin-tracer/zipkin_http_sender.rb', line 41

def flush!
  if @async
    HttpApiClient.perform_async(@json_api_host, spans.dup)
  else
    HttpApiClient.new.perform(@json_api_host, spans)
  end
end