Platform Docs
Agent Docs
Support Docs
Sequelize
Sequelize
Scout automatically instruments Sequelize v6 — no manual wrapping required. Every query executed via sequelize.query() or a model method gets a SQL/Query span in the Scout UI.
Setup
Ensure Scout is initialized before sequelize is required:
// scout.js
const { install } = require("@scout_apm/scout-apm");
install({
name: process.env.SCOUT_NAME || "my-app",
key: process.env.SCOUT_KEY,
monitor: true,
});
// app.js
require("./scout"); // must come before sequelize
const { Sequelize, DataTypes } = require("sequelize");
const db = new Sequelize("postgres://user:pass@localhost/mydb");
const User = db.define("User", { name: DataTypes.STRING });
// All queries are traced automatically
const users = await User.findAll();
await db.query("SELECT 1+1 AS result");
That’s it. Scout patches Sequelize at require-time.
What Gets Traced
Each query appears as a SQL/Query span with the following context:
| Context key | Value |
|---|---|
db.statement |
The full SQL string |
db.operation |
Operation type — SELECT, INSERT, UPDATE, DELETE, etc. |
db.model |
Table name (inferred from model, tableNames option, or SQL regex) |
error |
"true" if the query throws |
Supported Versions
Scout supports Sequelize v6.
Manual Instrumentation
For database queries Scout doesn’t capture automatically, see Custom Instrumentation for the manual instrument() approach.