Guides

OpenTelemetry

Send OpenTelemetry traces, logs, and metrics to RawTree with native OTLP.

OpenTelemetry

If you already have an OpenTelemetry SDK or Collector, point OTLP at RawTree and authenticate with a project API key.

export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT=https://api.rawtree.com/otlp
export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer%20$API_KEY"

RawTree writes traces to traces, logs to logs, and metrics to metrics by default.

Endpoints

SignalOTLP/HTTP endpointOTLP/gRPC serviceDestination table
TracesPOST /otlp/v1/tracesopentelemetry.proto.collector.trace.v1.TraceService/Exporttraces
LogsPOST /otlp/v1/logsopentelemetry.proto.collector.logs.v1.LogsService/Exportlogs
MetricsPOST /otlp/v1/metricsopentelemetry.proto.collector.metrics.v1.MetricsService/Exportmetrics

RawTree accepts OTLP/HTTP JSON (application/json), OTLP/HTTP protobuf (application/x-protobuf), and OTLP/gRPC protobuf. gzip-compressed requests are accepted on both transports. OTLP/HTTP request bodies are limited to 10 MiB after decompression; larger exports return 413.

For OTLP/gRPC, use https://api.rawtree.com as the endpoint. When running the local Docker Compose stack, use http://localhost:4317.

Custom destination tables

Set a signal-specific header when you want telemetry in a non-default table. The API key selects the project, and the header selects the table.

SignalHeader
Tracesx-rawtree-traces-table
Logsx-rawtree-logs-table
Metricsx-rawtree-metrics-table
export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer%20$API_KEY,x-rawtree-traces-table=my_traces"

OpenTelemetry Collector

Use the OTLP/HTTP exporter to forward all signals from a Collector:

exporters:
  otlphttp/rawtree:
    endpoint: https://api.rawtree.com/otlp
    headers:
      Authorization: Bearer ${env:RAWTREE_API_KEY}

See the full OpenTelemetry Collector example. For a sandbox telemetry walkthrough, see the Daytona OpenTelemetry example.

SDK snippets

Most SDKs read the same environment variables. Use these for Node.js, Python, Go, and other standard OTLP exporters:

export OTEL_SERVICE_NAME=my-service
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT=https://api.rawtree.com/otlp
export OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer%20$API_KEY"
export OTEL_EXPORTER_OTLP_COMPRESSION=gzip

If your exporter expects per-signal endpoints instead of a base endpoint, use:

export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=https://api.rawtree.com/otlp/v1/traces
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=https://api.rawtree.com/otlp/v1/logs
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=https://api.rawtree.com/otlp/v1/metrics

60-second smoke test

When setting up OTel collection, send one JSON OTLP span:

curl -X POST "https://api.rawtree.com/otlp/v1/traces" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"resourceSpans":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"otel-smoke-test"}}]},"scopeSpans":[{"spans":[{"traceId":"5B8EFFF798038103D269B633813FC60C","spanId":"EEE19B7EC3C1B174","name":"rawtree smoke test"}]}]}]}'

Query it back:

rtree query "SELECT name, service.name FROM traces WHERE service.name = 'otel-smoke-test' ORDER BY inserted_at DESC LIMIT 1"

If the query returns no rows, check insert logs:

rtree logs --type insert --status error --table traces --since 15m

Partial success

If RawTree accepts an export but drops invalid records, the OTLP response includes partialSuccess with rejectedSpans, rejectedLogRecords, or rejectedDataPoints plus an error message. Many SDKs do not surface partial success clearly, so check rtree logs when telemetry is missing.

Row shapes

Native OTLP endpoints apply RawTree's built-in OpenTelemetry transforms. See Transforms for the fields RawTree emits for traces, logs, and metrics.