Updating from node-airbrake for Node.js projects

Get the most out of Airbrake’s features and stay up to date with the latest improvements by updating your project to the latest version of our Node.js error reporting library.

Library note

This update guide is for projects on node-airbrake. For projects on airbrake-js, please visit our other guide. For projects on @airbrake/node, please visit our other guide.

Step 1: Uninstall airbrake

Uninstall the old package:

npm uninstall airbrake

Step 2: Install @airbrake/node

Install the new package with npm:

npm install @airbrake/node

We also support installation via Yarn.

Step 3: Replace mentions with new library

Note: Express.js users should follow our Express.js install guide.

Replace old configuration snippet instantiation:

var airbrake = require('airbrake').createClient(
  '123987',       // Project ID
  'abcdefg123456' // Project key
);
airbrake.handleExceptions();

With new package format:

var Airbrake = require('@airbrake/node');

var airbrake = new Airbrake.Notifier({
  projectId: '123987',
  projectKey: 'abcdefg123456',
});

Find advanced configuration options and examples on our official GitHub repo.

Performance Monitoring for Express.js apps

Application Performance Monitoring with Airbrake makes it easy to:

  • Understand high-level performance: Quickly see a broad performance overview for your whole application.
  • Monitor user satisfaction: Measure user satisfaction with your app performance using Apdex.
  • Catch problem routes: Identify routes with slow or error-prone performance.
  • Analyze granular performance metrics: Zoom into specific endpoints to see time spent in the DB, view, cache, external requests, and more.
  • Dive into database performance: Analyze SQL database queries being called and how long they take.
  • Track your background jobs: Monitor background job performance, track job failures and durations.

To get started, install our Express.js middleware as shown in the install guide. Performance Monitoring is completely automatic after installation - no extra setup required.

Congratulations!

Great job! If you’ve used this example in your app, you can visit your Airbrake project’s Performance Dashboard to see your performance data! Soon enough you’ll have more insights into your application’s performance. In the meantime why not check out the Performance Dashboard features. Have questions about Performance Monitoring? Check out our Performance Monitoring FAQ for more information.