node-postgres (pg package)

Our 2.x integration is deprecated, please upgrade to 3.x. Migration information is available here.

The AppSignal for Node.js integration for PostgreSQL, through the pg package v8.0.0+.


Add the @appsignal/nodejs package to your package.json. Then, run yarn install/npm install.

You can also add these packages to your package.json on the command line:

yarn add @appsignal/nodejs@2 npm install --save @appsignal/nodejs@2

You can then import and use the package in your app. No further steps are required to instrument calls made to your database - this is done automatically.


The integration will send the following instrumentation data to AppSignal:

  • ✅ Query duration
  • ✅ (Sanitized) SQL query body
  • ✅ Errors

These also work with any library that depends on the pg package as its database adapter, such as knex or TypeORM.