Sha256: 47dade417f1716e9d28ee8b0f83982895347e5de825a58c7d1a22d35d18daec9

Contents?: true

Size: 883 Bytes

Versions: 15

Compression:

Stored size: 883 Bytes

Contents

# frozen_string_literal: true

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

module OpenTelemetry
  module Exporter
    module Jaeger
      # A Thrift-compatible UDP transport.
      class Transport
        def initialize(host, port)
          @socket = UDPSocket.new
          @socket.connect(host, port)
          @buffer = ::Thrift::MemoryBufferTransport.new
        end

        def write(string)
          @buffer.write(string)
        end

        def flush
          @socket.send(@buffer.read(@buffer.available), 0)
          @socket.flush
        rescue Errno::ECONNREFUSED
          OpenTelemetry.logger.warn('Unable to connect to Jaeger Agent')
        rescue StandardError => e
          OpenTelemetry.logger.warn("Unable to send spans: #{e.message}")
        end

        def open; end

        def close; end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
opentelemetry-exporter-jaeger-0.23.0 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.22.0 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.21.0 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.20.2 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.20.1 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.20.0 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.19.0 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.18.0 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.17.0 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.16.0 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.15.0 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.14.0 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.13.0 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.12.0 lib/opentelemetry/exporter/jaeger/transport.rb
opentelemetry-exporter-jaeger-0.11.0 lib/opentelemetry/exporter/jaeger/transport.rb