Use OpenTelemetry auto-instrumentation for Node.js so your app can send traces, metrics, and logs to Rocketlog with minimal setup. You set environment variables and load the auto-instrumentation module before your application code runs.

Prerequisites

  • Node.js 18+
  • Your Rocketlog ingress endpoint: https://{your-ingress-endpoint}.rocketgraph.app

1. Install the auto-instrumentation package

Install the OpenTelemetry API and the Node auto-instrumentations metapackage:
npm install @opentelemetry/api @opentelemetry/auto-instrumentations-node
This metapackage includes instrumentations for http, express, pg, redis, mongodb, and many other libraries. See OpenTelemetry JS auto-instrumentations for the full list.

2. Configure via environment variables

Point the OTLP exporter at your Rocketlog ingress and set your service name:
export OTEL_EXPORTER_OTLP_ENDPOINT="https://{your-ingress-endpoint}.rocketgraph.app"
export OTEL_SERVICE_NAME="my-node-service"
export OTEL_TRACES_EXPORTER="otlp"
export OTEL_METRICS_EXPORTER="otlp"
export OTEL_LOGS_EXPORTER="otlp"
Replace {your-ingress-endpoint} with your actual Rocketlog ingress host (no path). The SDK will append the correct OTLP paths for traces, metrics, and logs.
Optional:
  • OTEL_EXPORTER_OTLP_PROTOCOL — Use http/protobuf (common for HTTP) or grpc.
  • OTEL_RESOURCE_ATTRIBUTES — Add attributes such as deployment.environment=production or k8s.pod.name=my-pod.

3. Run your application

Load the auto-instrumentation module with Node’s --require flag so it runs before your app. Your existing entry file stays the same:
node --require '@opentelemetry/auto-instrumentations-node/register' app.js
Or with a custom config file:
node --require ./tracing.js server.js
Example tracing.js that registers the same auto-instrumentations and uses env vars for the endpoint:
const { NodeSDK } = require('@opentelemetry/sdk-node');
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-http');
const { OTLPMetricExporter } = require('@opentelemetry/exporter-metrics-otlp-http');
const { PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics');

const sdk = new NodeSDK({
  traceExporter: new OTLPTraceExporter(),
  metricReader: new PeriodicExportingMetricReader({
    exporter: new OTLPMetricExporter(),
  }),
  instrumentations: [getNodeAutoInstrumentations()],
});
sdk.start();
Once the app is running, telemetry is sent to Rocketlog. In the dashboard, pick a time window to see traces, metrics, and logs and use AI root cause analysis.

Custom protocol

If your Rocketlog endpoint expects gRPC:
export OTEL_EXPORTER_OTLP_PROTOCOL="grpc"
export OTEL_EXPORTER_OTLP_ENDPOINT="https://{your-ingress-endpoint}.rocketgraph.app:4317"

Next steps