Sha256: 97ecbe00ad5b511db01a4c226bf251e9a4be869be9c8218c7a9ed14185d911ad

Contents?: true

Size: 708 Bytes

Versions: 8

Compression:

Stored size: 708 Bytes

Contents

# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

require 'pp'

module OpenTelemetry
  module SDK
    module Trace
      module Export
        # Outputs {SpanData} to the console.
        #
        # Potentially useful for exploratory purposes.
        class ConsoleSpanExporter
          def initialize
            @stopped = false
          end

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

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

            SUCCESS
          end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
opentelemetry-sdk-0.15.0 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-0.14.0 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-0.13.1 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-0.13.0 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-0.12.1 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-0.12.0 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-0.11.1 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-0.11.0 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb