The Atatus Node.js agent helps you in troubleshooting your Node.js application problems and also identifies performance issues before it becomes apparent to your users. It also captures unhandled exceptions and HTTP failures in production to determine which part of your Node.js application is slower or producing lots of errors. Create a free account to start monitoring your Node.js apps.

Installation & Setup

Step 1: Install Atatus Node.js Package

Step 2: Create atatus.js Initialization File

Create an atatus.js file in your project root with the following code:
Important: For TypeScript, use import * as atatus from 'atatus-nodejs' instead of the default import.

Step 3: Start Your Application

Use the -r flag to preload the atatus.js file when starting your Node.js application:
An example Docker command:

Step 4: Restart Your Server

Just restart your server and access it. You will visualize your application’s metrics within minutes.

Configuration Options

You can configure the Atatus agent in three ways:

Using Environment Variables

Using dotenv

Install the dotenv package and create a .env file:
For more advanced options on installing your monitoring code, view customizing agent.

Error Handling For ES Modules(Babel) & TypeScript

If you are using Atatus Node.js agent, for instance along with Babel, TypeScript for Node.js, you need to create and import atatus-promise-error-handler.js file.