Class: Jaeger::Span::ThriftLogBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/jaeger/span/thrift_log_builder.rb

Constant Summary collapse

FIELDS =
Jaeger::Thrift::Log::FIELDS
TIMESTAMP =
FIELDS[Jaeger::Thrift::Log::TIMESTAMP].fetch(:name)
LOG_FIELDS =
FIELDS[Jaeger::Thrift::Log::LOG_FIELDS].fetch(:name)

Class Method Summary collapse

Class Method Details

.build(timestamp, fields) ⇒ Object



10
11
12
13
14
15
# File 'lib/jaeger/span/thrift_log_builder.rb', line 10

def self.build(timestamp, fields)
  Jaeger::Thrift::Log.new(
    TIMESTAMP => (timestamp.to_f * 1_000_000).to_i,
    LOG_FIELDS => fields.map { |key, value| ThriftTagBuilder.build(key, value) }
  )
end