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

Defined in:
lib/datadog/tracing/transport/traces.rb

Overview

Encodes traces using Core::Encoding::Encoder instances.

Class Method Summary collapse

Class Method Details

.encode_trace(encoder, trace) ⇒ Object



98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/datadog/tracing/transport/traces.rb', line 98

def encode_trace(encoder, trace)
  # Format the trace for transport
  TraceFormatter.format!(trace)

  # Make the trace serializable
  serializable_trace = SerializableTrace.new(trace)

  Datadog.logger.debug { "Flushing trace: #{JSON.dump(serializable_trace)}" }

  # Encode the trace
  encoder.encode(serializable_trace)
end