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.



17
18
19
# File 'lib/opentelemetry/sdk/trace/export/console_span_exporter.rb', line 17

def initialize
  @stopped = false
end

Instance Method Details

#export(spans, timeout: nil) ⇒ Object



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

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

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

  SUCCESS
end

#shutdown(timeout: nil) ⇒ Object



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

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