Skip to main content

Module block_decoders

Module block_decoders 

Source
Expand description

BlockObjectDecoder implementations for OTLP logs/metrics/traces, used by parse_block BlockObjectDecoder implementations for OTLP ResourceLogs/ResourceMetrics/ ResourceSpans block payloads, used by parse_block to give a debug-level view into OTLP blocks (see the design plan for the row-shape rationale).

Each decoder walks scope_* → leaf records and emits one row per leaf (log record / span / metric data point), in payload order. The row’s value is a faithful OTLP/JSON dump of the leaf (via serde_json + jsonb::Value::from), plus a synthesized __-prefixed envelope (__type, __attributes, __resource, __scope, and — metrics only — __metric).

Structs§

OtelLogsBlockDecoder
Decodes OTLP ResourceLogs block payloads (streams.format = "otlp/v1/logs") into one row per LogRecord.
OtelMetricsBlockDecoder
Decodes OTLP ResourceMetrics block payloads (streams.format = "otlp/v1/metrics") into one row per data point (Sum/Gauge → otlp.NumberDataPoint, Histogram → otlp.HistogramDataPoint, ExponentialHistogram → otlp.ExponentialHistogramDataPoint, Summary → otlp.SummaryDataPoint). Per-data-point granularity lines up with measures and with metrics_bounds’s nb_objects counting basis (see the design plan §“Per-data-point vs. per-Metric rows for metrics”).
OtelTracesBlockDecoder
Decodes OTLP ResourceSpans block payloads (streams.format = "otlp/v1/traces") into one row per Span (with its events/links nested in the JSONB value).