Class: OpenTelemetry::SDK::Trace::Export::ConsoleSpanExporter

Inherits:
Object
  • Object
show all
Defined in:
lib/opentelemetry/sdk/trace/export/console_span_exporter.rb

Overview

Outputs SpanData to the console.

Potentially useful for exploratory purposes.

Instance Method Summary collapse

Constructor Details

#initializeConsoleSpanExporter

Returns a new instance of ConsoleSpanExporter.



15
16
17
# File 'lib/opentelemetry/sdk/trace/export/console_span_exporter.rb', line 15

def initialize
  @stopped = false
end

Instance Method Details

#export(spans, timeout: nil) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/opentelemetry/sdk/trace/export/console_span_exporter.rb', line 19

def export(spans, timeout: nil)
  return FAILURE if @stopped

  Array(spans).each { |s| pp s }

  SUCCESS
end

#force_flush(timeout: nil) ⇒ Object



27
28
29
# File 'lib/opentelemetry/sdk/trace/export/console_span_exporter.rb', line 27

def force_flush(timeout: nil)
  SUCCESS
end

#shutdown(timeout: nil) ⇒ Object



31
32
33
34
# File 'lib/opentelemetry/sdk/trace/export/console_span_exporter.rb', line 31

def shutdown(timeout: nil)
  @stopped = true
  SUCCESS
end