Skip to content

Node.js OpenTelemetry instrumentation

Osuite ingests OpenTelemetry data over OTLP. To instrument a Node.js service you install the OpenTelemetry SDK, load it before your application code, and point the OTLP exporters at your Osuite ingest endpoint. The same initialization module works for every framework — the framework guides below differ only in how the module is loaded and in framework-specific gotchas.

Node.js instrumentation is built from a small set of OpenTelemetry packages:

  • @opentelemetry/sdk-node — the NodeSDK entry point that starts tracing, metrics, and logging together and wires in the exporters.
  • @opentelemetry/auto-instrumentations-nodegetNodeAutoInstrumentations(), a bundle that automatically instruments popular libraries (HTTP, Express, Fastify, database clients, and more) with no code changes.
  • @opentelemetry/exporter-trace-otlp-proto, @opentelemetry/exporter-metrics-otlp-proto, @opentelemetry/exporter-logs-otlp-proto — the OTLP exporters that send each signal to Osuite over HTTP/protobuf. gRPC variants (-grpc) are also available if you prefer that transport.
  • @opentelemetry/api — the API surface you use for custom spans, attributes, and metrics.

A fully instrumented service sends all three OpenTelemetry signals to Osuite:

  • Traces — spans for every inbound request and outbound call, captured automatically by the auto-instrumentations and enriched with your own custom spans.
  • Metrics — runtime and HTTP metrics from the auto-instrumentations, plus any custom counters, histograms, and gauges you define.
  • Logs — application logs correlated to traces when you route them through the OpenTelemetry logs pipeline.

Each guide is a complete copy-paste path: install, initialization module, environment variables, and how to run on a bare host, in Docker, and on Kubernetes.

  • Custom instrumentation — add manual spans, span attributes, and custom metrics with the OpenTelemetry API.
  • Troubleshooting — ESM vs CommonJS loading, the --require flag, missing spans, and exporter connectivity.