Skip to main content

Module json_log_encoder

Module json_log_encoder 

Source
Expand description

JSON “log exporter” trace encoder.

Emits traces in the newline-delimited JSON format consumed by the Datadog Forwarder Lambda (the legacy serverless path used when no Datadog Agent / Lambda Extension is reachable). Each emitted line is a self-contained JSON document of the form:

{"traces":[[ {span}, {span}, ... ]]}\n

Spans are greedily packed into size-bounded lines. A single span that alone exceeds the line cap is dropped (and counted in EncodeStats::spans_dropped) rather than emitted as a truncated, unparseable line.

See the cross-language specification for the wire contract and the Forwarder’s is_trace detection requirements.

Structs§

EncodeStats
Statistics reported by encode_traces.

Functions§

encode_traces
Encodes traces into newline-delimited JSON “log exporter” lines, writing them to out.