Platform Docs
Agent Docs
Support Docs
Node Agent
Scout’s Node.js agent instruments popular libraries to capture middleware timing, SQL queries, template rendering, HTTP calls, and more.
The package is called @scout_apm/scout-apm on npm.
Source code and issues can be found on our scout_apm_node GitHub repository.
Requirements
@scout_apm/scout-apm requires:
- Node.js 18+
- A POSIX operating system, such as Linux or macOS.
Instrumented Libraries
Scout automatically instruments the following libraries when you call init():
Web Frameworks
Databases
- PostgreSQL via
pg - MySQL via
mysqlandmysql2 - MongoDB via
mongodb(v4+) - Prisma via
@prisma/client(Prisma 6+)
Caching
HTTP Clients
- Node.js built-in
httpandhttpsmodules - Native
fetch/undici(Node.js 18+, viadiagnostics_channel)
Templating
You can instrument your own code via custom instrumentation. You can suggest additional libraries you’d like Scout to instrument on GitHub.
Initialization
Scout hooks into Node’s module system to instrument libraries as they load. The recommended pattern is a dedicated scout.js (or scout.ts) file that calls init() before any other code runs:
# No code changes needed — use the preload flag
node --require @scout_apm/scout-apm/preload app.js
Or create a scout.js and require it first:
// scout.js
const { init } = require("@scout_apm/scout-apm");
init({ name: "My App", key: process.env.SCOUT_KEY, monitor: true });
See the Setup guide for the complete initialization pattern for your framework.
Updating to the Newest Version
npm install @scout_apm/scout-apm@latest
The package changelog is available here.