Skip to main content

Module logs

Module logs 

Source
Expand description

OTLP logs -> Arrow, one allocation-lean pass over the decoded protobuf.

The builder accumulates across many export requests and is drained once, at flush. RecordBatch is immutable and has no append, so the accumulation lives in Arrow’s typed builders (which own growable Vecs) rather than in a Vec<RecordBatch> that would need concat_batches at flush — that costs roughly 2x peak memory for the duration of the concat.

Everything shared with traces and metrics — the attribute tables and the Resource-Scope preamble — lives in crate::attrs. What is left here is the logs root table and nothing else.

Structs§

LogsBuilder

Functions§

append_fixed 🔒
OTLP leaves trace_id/span_id empty when unset; anything that is neither empty nor the exact width is malformed and becomes null rather than an error — a bad id must not cost the caller the whole export.
nanos 🔒
One OTLP fixed64 nanosecond timestamp, read into the Int64 Arrow uses.
now_nanos 🔒
The wall clock, read the way the rest of the tree reads it. Used for exactly one thing — a log record that carries no timestamp of any kind — because the receipt time is the only honest stamp left for one, and a stored zero is what makes a block match every query ever asked.