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



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

def initialize
  @stopped = false
end

Instance Method Details

#export(spans) ⇒ Object



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

def export(spans)
  return ResultCodes::FAILURE if @stopped

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

  ResultCodes::SUCCESS
end

#shutdownObject



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

def shutdown
  @stopped = true
end