Skip to main content

Crate otlp2records

Crate otlp2records 

Source
Expand description

otlp2records - Transform OTLP telemetry to Arrow RecordBatches

This crate provides synchronous, WASM-compatible transformation of OpenTelemetry Protocol (OTLP) data (logs, traces, metrics) into Arrow RecordBatches.

§Design Principles

  • No I/O: Core never touches network or filesystem
  • No async: Pure synchronous transforms
  • WASM-first: All dependencies compile to wasm32
  • Arrow-native: RecordBatch is the canonical output format

§High-level API

The simplest way to use this crate is with the high-level transform functions:

use otlp2records::{transform_logs, transform_traces, transform_metrics, InputFormat};

let batch = transform_logs(bytes, InputFormat::Protobuf)?;
let batch = transform_traces(bytes, InputFormat::Json)?;
let batches = transform_metrics(bytes, InputFormat::Protobuf)?;

Modules§

fixtures
Synthetic OTLP protobuf fixture encoders.
otap
Stateful native OTAP input.
proto_output
Protobuf output helpers for compatibility endpoints.

Structs§

JsonMetricBatches
Result of transforming OTLP metrics to JSON values.
MetricBatches
Result of transforming OTLP metrics to Arrow RecordBatches.
PartitionedBatch
A RecordBatch with partition metadata for storage routing.
PartitionedMetrics
Partitioned metrics result, with each metric type grouped by service.
ServiceGroupedBatches
Multiple batches grouped by service name.
SkippedMetrics
Tracks metrics that were skipped during transformation.
TransformCounterValue
A counted transform event.
TransformPhaseTiming
A measured transform phase.

Enums§

DecodeError
Errors that can occur during OTLP decoding.
Error
Errors that can occur during OTLP to RecordBatch transformation
InputFormat
Input format for OTLP decoding.
TransformCounter
Counted transform event.
TransformPhase
Timed transform phase.
TransformSignal
Telemetry signal being transformed.

Traits§

TransformObserver
Optional sink for transform timing observations.

Functions§

exp_histogram_schema
extract_min_timestamp_micros
Extract the minimum timestamp from a RecordBatch, in microseconds.
extract_service_name
Extract the first service name from a RecordBatch.
gauge_schema
group_batch_by_service
Group a RecordBatch by service_name column.
histogram_schema
logs_schema
sum_schema
to_ipc
Serialize a RecordBatch to Arrow IPC streaming format
to_json
Serialize a RecordBatch to NDJSON format (newline-delimited JSON)
traces_schema
transform_logs
Transform OTLP logs to Arrow RecordBatch.
transform_logs_json
Transform OTLP logs to JSON values.
transform_logs_partitioned
Transform OTLP logs with service-based partitioning.
transform_logs_with_observer
Transform OTLP logs while reporting phase timings to an observer.
transform_metrics
Transform OTLP metrics to Arrow RecordBatches.
transform_metrics_json
Transform OTLP metrics to JSON values.
transform_metrics_partitioned
Transform OTLP metrics with service-based partitioning.
transform_metrics_with_observer
Transform OTLP metrics while reporting phase timings to an observer.
transform_traces
Transform OTLP traces to Arrow RecordBatch.
transform_traces_json
Transform OTLP traces to JSON values.
transform_traces_partitioned
Transform OTLP traces with service-based partitioning.
transform_traces_with_observer
Transform OTLP traces while reporting phase timings to an observer.

Type Aliases§

Result
Result type alias using the crate’s Error type