Skip to main content
Rootprint accepts OpenTelemetry logs over OTLP HTTP. Node apps can use the plain OTEL SDK, or plug OTLP into Pino or Winston. All three routes ship records through the same endpoint and 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>.
  • Node.js 18+ with npm (the SDK needs native fetch and top-level await).
  • 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

Node.js 18+ is required (for native fetch and top-level await).
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-node-service, and your record should appear within ~2 seconds.

Structured logging

Attributes become log-record attributes on the OTEL side: searchable and filterable in Rootprint.
With Pino, pass an object as the first argument:

Framework recipe: Express

Initialise the SDK once at process start, then log from anywhere. Keep the setup in a separate module (e.g. otel.js) and import it before your Express app.

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: the batch processor buffers records. For short-lived scripts call await provider.forceFlush() (or await provider.shutdown()) before exit.
  • fetch is not defined: upgrade to Node.js 18+ or pass a polyfilled fetch to the exporter.
  • Pino transport not emitting: pino-opentelemetry-transport reads the OTEL_* env vars itself; make sure they are set in the process that spawns the transport worker.
  • TLS errors against a self-signed endpoint: set NODE_EXTRA_CA_CERTS=/path/to/ca.pem.