Sha256: 2baf61e43e6f94c537e6509b681d7cb766c3e485b880a64a75f2d39c82dda6f2

Contents?: true

Size: 783 Bytes

Versions: 11

Compression:

Stored size: 783 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 force_flush(timeout: nil)
            SUCCESS
          end

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
opentelemetry-sdk-1.2.0 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-1.1.0 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-1.0.3 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-1.0.2 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-1.0.1 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-1.0.0 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-1.0.0.rc3 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-1.0.0.rc2 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-1.0.0.rc1 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-0.17.0 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb
opentelemetry-sdk-0.16.0 lib/opentelemetry/sdk/trace/export/console_span_exporter.rb