Class: Jaeger::Reporters::RemoteReporter

Inherits:
Object
  • Object
show all
Defined in:
lib/jaeger/reporters/remote_reporter.rb,
lib/jaeger/reporters/remote_reporter/buffer.rb

Defined Under Namespace

Classes: Buffer

Instance Method Summary collapse

Constructor Details

#initialize(sender:, flush_interval:) ⇒ RemoteReporter

Returns a new instance of RemoteReporter.



8
9
10
11
12
# File 'lib/jaeger/reporters/remote_reporter.rb', line 8

def initialize(sender:, flush_interval:)
  @sender = sender
  @flush_interval = flush_interval
  @buffer = Buffer.new
end

Instance Method Details

#flushObject



14
15
16
17
18
# File 'lib/jaeger/reporters/remote_reporter.rb', line 14

def flush
  spans = @buffer.retrieve
  @sender.send_spans(spans) if spans.any?
  spans
end

#report(span) ⇒ Object



20
21
22
23
24
25
# File 'lib/jaeger/reporters/remote_reporter.rb', line 20

def report(span)
  return if !span.context.sampled? && !span.context.debug?

  init_reporter_thread
  @buffer << span
end