Class: OpenTelemetry::Exporter::Jaeger::Transport
- Inherits:
-
Object
- Object
- OpenTelemetry::Exporter::Jaeger::Transport
- Defined in:
- lib/opentelemetry/exporter/jaeger/transport.rb
Overview
A Thrift-compatible UDP transport.
Instance Method Summary collapse
- #close ⇒ Object
- #flush ⇒ Object
-
#initialize(host, port) ⇒ Transport
constructor
A new instance of Transport.
- #open ⇒ Object
- #write(string) ⇒ Object
Constructor Details
#initialize(host, port) ⇒ Transport
Returns a new instance of Transport.
12 13 14 15 16 |
# File 'lib/opentelemetry/exporter/jaeger/transport.rb', line 12 def initialize(host, port) @socket = UDPSocket.new @socket.connect(host, port) @buffer = ::Thrift::MemoryBufferTransport.new end |
Instance Method Details
#close ⇒ Object
33 |
# File 'lib/opentelemetry/exporter/jaeger/transport.rb', line 33 def close; end |
#flush ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/opentelemetry/exporter/jaeger/transport.rb', line 22 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.}") end |
#open ⇒ Object
31 |
# File 'lib/opentelemetry/exporter/jaeger/transport.rb', line 31 def open; end |
#write(string) ⇒ Object
18 19 20 |
# File 'lib/opentelemetry/exporter/jaeger/transport.rb', line 18 def write(string) @buffer.write(string) end |