Method: Trace::ZipkinKafkaSender#initialize

Defined in:
lib/zipkin-tracer/zipkin_kafka_sender.rb

#initialize(options = {}) ⇒ ZipkinKafkaSender

Returns a new instance of ZipkinKafkaSender.



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/zipkin-tracer/zipkin_kafka_sender.rb', line 19

def initialize(options = {})
  @topic  = options[:topic] || DEFAULT_KAFKA_TOPIC

  if options[:producer] && options[:producer].respond_to?(:push)
    @producer = options[:producer]
  elsif options[:zookeepers]
    initialize_hermann_producer(options[:zookeepers])
  else
    raise ArgumentError, "No (kafka) :producer option (accepting #push) and no :zookeeper option provided."
  end
  super(options)
end