Skip to main content
Rootprint accepts OpenTelemetry logs over OTLP HTTP (proto-http). The Python SDK’s OTLPLogExporter speaks this protocol directly. Install it, set three env vars, and emit records through logging. Records land in the OTEL logs index pinned by your ingest API key (otel-logs-v0_9 in these examples).

Prerequisites

  • A running Rootprint instance and its base URL — you’ll substitute it for <your-rootprint>.
  • Python 3.8+ with pip.
  • An ingest API key scoped to your target index. In Settings → API keys, click Create ingest key, give it a name, and pick the index (otel-logs-v0_9 for the examples here). See API keys.

Setup

1

Install the OpenTelemetry SDK

Python 3.8+ is required. For async apps, add opentelemetry-instrumentation-asyncio.
2

Set environment variables

The %20 after Bearer is required. OTEL expects URL-encoded header values.
3

Minimal working example

4

Verify in Rootprint

Open Search, filter on service_name:my-python-service, and your record should appear within ~2 seconds (one batch interval).

Structured logging

Attach attributes via the extra kwarg on the standard logging API. The OTEL handler translates them into log record attributes.
They land under attributes.user_id and attributes.plan in Rootprint and become searchable and filterable.

Framework recipe: FastAPI

FastAPI apps work the same way. Set up the provider once at startup. Put the exporter config in your app factory so every worker process picks it up.

Troubleshooting

  • 401 / 403: the Bearer token is missing, malformed, or the %20 separator is not URL-encoded. Re-check OTEL_EXPORTER_OTLP_LOGS_HEADERS.
  • Nothing in Search: records are batched; wait 2–5 s or call logger_provider.force_flush() from your script. Also verify OTEL_SERVICE_NAME is set so you can filter on service_name.
  • TLS errors against a self-signed endpoint: set OTEL_EXPORTER_OTLP_CERTIFICATE=/path/to/ca.pem.
  • Records rejected by Quickwit: the API key is scoped to a specific index. If that index’s schema doesn’t accept the record, create an API key for a different index. See Manage indexes.
  • OTLP reference: endpoint URL, response codes, env-var table
  • Indexes: otel-logs-v0_9 schema and custom-index concepts
  • Manage indexes: map log level, message, and traceback fields