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.
SDK packages
Section titled “SDK packages”Node.js instrumentation is built from a small set of OpenTelemetry packages:
@opentelemetry/sdk-node— theNodeSDKentry point that starts tracing, metrics, and logging together and wires in the exporters.@opentelemetry/auto-instrumentations-node—getNodeAutoInstrumentations(), 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.
The three signals
Section titled “The three signals”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.
Framework guides
Section titled “Framework guides”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.
Express Instrument an Express API.
Next.js Instrument a Next.js app via the instrumentation hook.
NestJS Instrument a NestJS service.
Fastify Instrument a Fastify server.
Beyond the defaults
Section titled “Beyond the defaults”- Custom instrumentation — add manual spans, span attributes, and custom metrics with the OpenTelemetry API.
- Troubleshooting — ESM vs CommonJS loading, the
--requireflag, missing spans, and exporter connectivity.