Skip to main content

Module otlp

Module otlp 

Source
Expand description

The otlp format for COPY FROM STDIN: one binary OTLP payload for any of the three signals — ExportMetricsServiceRequest, ExportTraceServiceRequest or ExportLogsServiceRequest.

COPY FROM STDIN WITH (FORMAT otlp [, signal 'traces'] [, <options>]) is a GreptimeDB-specific, binary format (wire format code 1). Like the influxdb format it is table-less and does not decode here: the whole payload is buffered until CopyDone — exactly like an OTLP/HTTP request body — then decoded and completed through the frontend’s OpenTelemetryProtocolHandler, the same path the /v1/otlp/v1/{metrics,traces,logs} endpoints use, under the connection’s regular postgres query context.

The WITH options carry what the HTTP endpoints take as request headers; values already provided by the postgres session (database, user, permissions) are not repeated. Option semantics, defaults and parsing helpers are shared with the HTTP extractors (truthy, SelectInfo, GreptimePipelineParams, PipelineWay), so the two ingestion routes cannot drift.

One COPY statement is one bounded ingestion request (see crate::postgres::copy_in::COPY_IN_MAX_PAYLOAD_BYTES).

Structs§

OtlpOptions 🔒
The format’s validated options: the signal and its header-equivalent configuration, carried to the flush that completes the copy.

Enums§

OtlpSignal 🔒

Functions§

build_otlp_codec 🔒
take_truthy 🔒
Takes a boolean option with the HTTP header’s exact truthy spellings (true, 1, yes, on, t), plus the COPY forms (bare flag or TRUE/FALSE), so both routes accept the same values.