intellim-node-sdk
v1.1.0
Published
One-line auto-instrumentation for Node.js/Express apps — traces, metrics, and error logs sent to an IntelliM backend, with distributed trace propagation across services.
Maintainers
Readme
intellim-node-sdk
One-line auto-instrumentation for Node.js / Express applications, reporting to a IntelliM backend.
Install
npm install intellim-node-sdkUsage
const intellim = require("intellim-node-sdk");
const { middleware } = intellim.init({
serviceName: "my-app",
backendUrl: "https://your-intellim-backend.example.com",
apiKey: "your-api-key", // or set INTELLIM_API_KEY in the environment
});
app.use(middleware);That's it — every request handled after this point is automatically traced.
What gets captured automatically
- Per request: route, method, status, duration → sent as a trace
- Per request: response time → sent as a metric
- Errors and slow requests (4xx/5xx, or over 1s) → sent as log lines
- Every 10 seconds: app-level rollups — memory usage, average response time, request throughput, error rate
Distributed tracing across services
If this app calls another IntelliM-instrumented service over HTTP, the current request's trace ID is automatically propagated onto that outgoing call — no extra code needed. The two services' spans show up correlated under one trace in the IntelliM dashboard, instead of two disconnected traces.
This works by patching Node's core http/https modules (not by patching
whatever HTTP client library your app happens to use) — the two SDK
instances a service and the app it calls each have their own separate copy
of a package like axios, but there is only ever one http module in a
given Node process, so that's what reliably carries the trace context
across the boundary regardless of which library made the actual call.
Configuration
| Option | Required | Default | Notes |
|---------------|----------|-----------------------------|---------------------------------------------|
| serviceName | No | "unknown-service" | Shows up as this service's name everywhere |
| backendUrl | No | http://localhost:3001 | Your IntelliM backend's URL |
| apiKey | No* | process.env.INTELLIM_API_KEY | *Required for any data to actually be accepted — falls back to the env var if not passed explicitly |
| debug | No | false | Logs [NexusRUM]-style debug lines to the console |
License
MIT
