Node.js Monitoring
Node.js monitoring,
without a proprietary agent.
Trace every request through Express, Fastify or Next.js, down to the database and cache calls it makes. Instrumentation is the open-source OpenTelemetry SDK, started with one flag, so your code stays vendor-neutral.
What you see
Traces, metrics and logs from Node.js
The auto-instrumentation package registers before your application loads, through Node's --require flag.
Distributed traces
Every inbound request and outbound call as spans, propagated across services with W3C trace context.
Runtime and HTTP metrics
Request rate, latency histograms and error counts per route, exported over OTLP.
Correlated logs
Log lines carry the trace and span ID, so a slow trace opens straight onto its logs.
Frameworks and libraries
Each of these has official OpenTelemetry instrumentation. aiAxonIQ receives it over OTLP, so anything the OpenTelemetry project adds for Node.js works here too.
- Express
- Fastify
- Koa
- NestJS
- Next.js
- http / https
- PostgreSQL (pg)
- MySQL
- Redis
- MongoDB
- gRPC
- Kafka
Set up
Send Node.js telemetry in three steps
The full guide, including sampling and resource attributes, is in the documentation.
1Install
npm install @opentelemetry/api @opentelemetry/auto-instrumentations-node2Configure
export OTEL_EXPORTER_OTLP_ENDPOINT="https://app.aiaxoniq.com/otlp" export OTEL_EXPORTER_OTLP_HEADERS="x-license-key=YOUR_LICENSE_KEY" export OTEL_SERVICE_NAME="my-service"3Run
node --require @opentelemetry/auto-instrumentations-node/register your-app.jsIt is --require rather than an import at the top of your entry file: the hook has to install instrumentation before your application modules resolve. An import runs after the modules it needs to patch are already loaded, and produces an app that starts cleanly and emits nothing.
How the data flows
- 1. Instrument. The OpenTelemetry SDK for Node.js records spans, metrics and logs in your process.
- 2. Export. It sends them over OTLP, straight to aiAxonIQ or through an OpenTelemetry Collector you already run.
- 3. Explore. Traces, metrics and logs land in one store, so a slow request opens onto its queries and its log lines.
Because the wire format is OTLP, the same instrumentation works with any OpenTelemetry backend. Moving to aiAxonIQ, or away from it, is an endpoint change.
Node.js questions
- Does it work with TypeScript and ES modules?
- TypeScript compiled to CommonJS works as-is with the --require flag. Native ES modules need the OpenTelemetry ESM loader hook passed with --import, so instrumentation can patch modules as they load; the documentation covers both.
- Can I add my own spans?
- Yes. Use the @opentelemetry/api package to start spans around the work that matters to you; they join the automatic spans in the same trace.