Guides

Ingest data

Ingest unstructured data from inline payloads, files, and public URLs.

Ingest data

RawTree accepts unstructured data without a schema step. A table is created automatically on first insert.

Inline data

rtree insert --table events \
  --data '{"action":"signup","user_id":1}'

Use an array to insert multiple rows:

rtree insert --table events \
  --data '[{"action":"signup","user_id":1},{"action":"purchase","user_id":1,"amount":42}]'

Files

rtree insert --table events --file ./events.jsonl

JSONL is useful for large event streams because each line is one event.

Public URLs

rtree insert --table events --url https://example.com/events.jsonl

URL ingest streams progress events through the API and CLI.

Built-in transforms

Use transforms when the source format needs to be flattened before insert. A transform is a built-in preprocessor for JSON body inserts: RawTree reads the source JSON, emits one or more flat rows, then inserts those rows into the table.

rtree insert --table traces \
  --data '{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"api"}}]},"scopeSpans":[{"spans":[{"name":"GET /health","spanId":"abc"}]}]}' \
  --transform otlp-traces

The API accepts the same transform through the transform query parameter on a JSON body insert:

curl -X POST "https://api.rawtree.com/v1/tables/traces?transform=otlp-traces" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"api"}}]},"scopeSpans":[{"spans":[{"name":"GET /health","spanId":"abc"}]}]}'

OpenTelemetry SDKs and collectors can also use native OTLP endpoints:

POST /otlp/v1/traces
POST /otlp/v1/logs
POST /otlp/v1/metrics

These routes accept OTLP/HTTP JSON or protobuf, apply the matching OpenTelemetry transform, and insert into the default traces, logs, or metrics table. If RawTree accepts the export but drops invalid signal records, the OTLP response includes partialSuccess with the signal-specific rejected count.

To write native OTLP into custom tables, set the matching signal header: x-rawtree-traces-table, x-rawtree-logs-table, or x-rawtree-metrics-table. The API key selects the project, and the table header selects the destination table.

For SDKs that use OTLP/HTTP endpoint environment variables, set OTEL_EXPORTER_OTLP_ENDPOINT=https://api.rawtree.com/otlp so exporters append the standard /v1/traces, /v1/logs, or /v1/metrics signal paths under the OTLP namespace.

SDKs that use OTLP/gRPC can send the standard collector services to https://api.rawtree.com with OTEL_EXPORTER_OTLP_PROTOCOL=grpc and authorization=Bearer%20$API_KEY in OTEL_EXPORTER_OTLP_HEADERS. The same x-rawtree-*-table headers can be sent as gRPC metadata. Local Docker Compose exposes OTLP/gRPC on http://localhost:4317.

Transforms are not supported with URL inserts. If you use ?url=, transform the data before hosting it.

See Transforms for supported input shapes and emitted rows.

TransformSource format
otlp-tracesOpenTelemetry trace payloads
otlp-logsOpenTelemetry log payloads
otlp-metricsOpenTelemetry metric payloads
cloudwatch-logsAWS CloudWatch Logs subscription or delivery payloads
cloudtrailAWS CloudTrail records
firehoseAWS Firehose HTTP endpoint delivery payloads

API insert

curl -X POST "https://api.rawtree.com/v1/tables/events" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"action":"signup","user_id":1}]'

Verify the insert

rtree table describe events
rtree query "SELECT count() FROM events"