After you install the ARMS Application Monitoring Node.js agent, it automatically instruments supported frameworks and components at startup, collecting request traces, call latency, errors, database access, messaging calls, log-trace correlation, runtime metrics, and AI call traces.
Prerequisites
-
(Recommended) Node.js 14.x or later. For AI-related components and ESM Loader scenarios, use Node.js 16 or later. For production environments, use Node.js 18 or Node.js 20 LTS.
-
The ARMS Node.js agent is installed.
npm install @loongsuite/cms_node_sdk -
The agent must load before your application frameworks and components. If modules such as
express,mysql2, oropenaiload before the agent starts, instrumentation may be incomplete. For CommonJS applications, use the-rflag to preload the agent. For ESM applications, use the Loader approach.node -r @loongsuite/cms_node_sdk/register app.js node --experimental-loader=@loongsuite/cms_node_sdk/import-hooks app.mjs
Instrumentation behavior
For Node.js built-in modules, runtime metrics, and diagnostics channel-based instrumentation, the agent does not filter by npm package version. Instead, instrumentation depends on the Node.js runtime version and whether the module exposes a collectible entry point.
If a framework is not listed below but uses Node.js built-in modules such as http, https, undici, or net, the agent can still collect basic entry or exit traces. Framework-specific capabilities such as routing, middleware, Agent, and Tool require dedicated instrumentation.
Web frameworks
|
Component or framework |
npm package |
Supported versions |
Collected data |
|
Express |
express |
>=4.0.0 <6.0.0 |
HTTP entry traces, routing information, middleware and handler execution, and error messages |
|
Koa |
koa |
>=2.0.0 <4.0.0 |
HTTP entry traces, middleware execution, routing information, and error messages |
|
Socket.IO |
socket.io |
2.x, >=3.0.0 <5.0.0 |
Event sending and receiving, namespaces, room broadcasting, message latency, and error messages |
HTTP, RPC, and network communication
|
Component or module |
npm package |
Supported versions |
Collected data |
|
Node.js HTTP |
http, https |
Node.js built-in module |
HTTP server entries, HTTP client exits, status codes, request latency, request and response sizes, and error messages |
|
Undici |
undici |
No fixed semver range |
HTTP client requests, status codes, latency, and error messages collected through the diagnostics channel |
|
gRPC |
@grpc/grpc-js |
>=1.0.0 <2.0.0 |
gRPC client and server calls, service and method, status codes, latency, and error messages |
|
DNS |
dns, dns/promises |
Node.js built-in module |
DNS lookup calls, resolution latency, and error messages |
|
TCP/Unix Socket |
net |
Node.js built-in module |
TCP and Unix Socket connections, destination addresses, ports, and connection errors |
Databases and ORMs
|
Component or framework |
npm package |
Supported versions |
Collected data |
|
MySQL |
mysql |
>=2.0.0 <3.0.0 |
SQL call traces, SQL statements, connection information, slow queries, and error messages |
|
MySQL2 |
mysql2 |
>=1.4.2 <4.0.0 |
SQL call traces, query and execute operations, SQL statements, connection information, slow queries, and error messages |
|
PostgreSQL |
pg |
>=8.0.3 <9.0.0 |
SQL call traces, SQL statements, connection information, slow queries, and error messages |
|
PostgreSQL Pool |
pg-pool |
>=2.0.0 <4.0.0 |
Connection pool connect calls and supplementary database access trace information |
|
MongoDB |
mongodb |
>=3.3.0 <4.0.0, >=4.0.0 <7.0.0 |
MongoDB commands, collections, database names, connection information, latency, and error messages |
|
Mongoose |
mongoose |
>=5.9.7 <9.0.0 |
Model, Query, and Aggregate calls, collection information, database operations, latency, and error messages |
Caching and message queues
|
Component or framework |
npm package |
Supported versions |
Collected data |
|
Redis |
redis |
>=2.6.0 <4.0.0 |
Redis commands, connection information, call latency, and error messages |
|
Node Redis Client |
@redis/client, @node-redis/client |
>=1.0.0 <2.0.0, >=5.0.0 <6.0.0 |
Redis v4 and v5 client commands, multi commands, connection information, call latency, and error messages |
|
ioredis |
ioredis |
>=2.0.0 <6.0.0 |
Redis commands, connection information, call latency, and error messages |
|
KafkaJS |
kafkajs |
>=0.3.0 <3.0.0 |
Kafka producer and consumer calls, topics, message send and receive latency, and error messages |
Logging frameworks
|
Component or framework |
npm package |
Supported versions |
Collected data |
|
Pino |
pino |
>=7.0.0 <11.0.0 |
Trace correlation field injection into logs |
|
Winston |
winston |
>=3.0.0 <4.0.0 |
Trace correlation field injection into logs |
|
Bunyan |
bunyan |
>=1.8.0 <3.0.0 |
Trace correlation field injection into logs |
|
Console |
console |
Node.js global object |
Trace correlation field injection into console.log, console.info, console.warn, and console.error |
AI application components
|
Component or framework |
npm package |
Supported versions |
Collected data |
|
OpenAI Node SDK |
openai |
>=4.0.0 <6.0.0 |
Chat, Completion, and Image calls, model information, token usage, streaming calls, and error messages |
|
LangChain JS |
@langchain/core, langchain |
No fixed semver range. Subject to the availability of module entry points such as @langchain/core/callbacks/manager. |
Chain, LLM, Tool, Retriever, and Embedding run traces, token usage, and error messages |
|
LangGraph |
@langchain/langgraph |
No fixed semver range. Subject to the availability of module entry points such as @langchain/langgraph/prebuilt and @langchain/langgraph/pregel. |
ReAct Agent, Pregel stream, Agent and Step metadata, forming complete Agent traces in collaboration with LangChain instrumentation |
|
Vercel AI SDK |
ai |
>=4.0.0 <7.0.0 |
generateText, streamText, generateObject, streamObject, Tool, Embedding, Rerank, and Agent call traces |
|
Anthropic Claude Agent SDK |
@anthropic-ai/claude-agent-sdk |
>=0.3.0 <1.0.0 |
query and startup calls, Agent runs, model requests, tool calls, session information, token usage, and error messages |
Node.js runtime metrics
|
Metric category |
Collection target |
Collected data |
|
Event Loop |
Node.js event loop |
Event loop delay, event loop utilization, and other metrics |
|
V8 |
V8 engine |
Heap memory, GC count, GC latency, heap space usage, and other metrics |
|
Process |
Node.js process |
CPU, memory, thread-related metrics, context switches, and other process metrics |
Configuration
All built-in instrumentations are enabled by default. You can adjust them per application in the ARMS console or through the instrumentations field when initializing the SDK.
The following example configures the instrumentations field:
const { NodeSDK } = require('@loongsuite/cms_node_sdk');
const sdk = new NodeSDK({
serviceName: 'your-app-name',
licenseKey: 'your-license-key',
regionId: 'cn-hangzhou',
instrumentations: {
mysql2: {
enabled: true
},
openai: {
enabled: true
},
vercel_ai: {
enabled: true
},
},
});
sdk.start();
Common configuration keys:
|
Category |
Configuration keys |
|
HTTP and network |
|
|
Web frameworks |
|
|
Databases |
|
|
Caching and messaging |
|
|
Logging |
|
|
AI |
|
|
Runtime |
|
The configuration key for Mongoose is moogoose, not mongoose. This is a known code-level key name. The Mongoose component is displayed as mongoose in user-facing contexts. If you explicitly configure the Mongoose instrumentation switch in code, use moogoose.
Usage notes
-
AI components may collect request body content such as prompts, responses, and tool inputs/outputs. In production, configure collection policies and maximum length limits based on your compliance requirements.
-
For unlisted components, the agent may still collect basic traces through underlying HTTP, RPC, or database client instrumentation, but framework-specific semantic fields and view capabilities are not guaranteed.
-
Component version ranges are updated with each agent release. After upgrading, check the documentation and release notes for updated version support.