Module: Datadog::Tracing::Transport::IO::Traces::Encoder

Included in:
Parcel
Defined in:
lib/datadog/tracing/transport/io/traces.rb

Overview

Encoder for IO-specific trace encoding API compliant when used with JSONEncoder.

Constant Summary collapse

ENCODED_IDS =
[
  :trace_id,
  :span_id,
  :parent_id
].freeze

Instance Method Summary collapse

Instance Method Details

#encode_traces(encoder, traces) ⇒ Object

Encodes a list of traces



57
58
59
60
61
62
63
64
# File 'lib/datadog/tracing/transport/io/traces.rb', line 57

def encode_traces(encoder, traces)
  trace_hashes = traces.map do |trace|
    encode_trace(trace)
  end

  # Wrap traces & encode them
  encoder.encode(traces: trace_hashes)
end