Installation & Setup for NestJS
Install Atatus Node.js package.
copynpm install --save atatus-nodejs
If you are using NestJS, you have to import like
import * as atatus from 'atatus-nodejs'
in your NestJS app and invoke start with your License key and App name:copy// It must be placed above all other 'require' statements import * as atatus from 'atatus-nodejs'; atatus.start({ licenseKey: "YOUR_LICENSE_KEY", appName: "YOUR_APP_NAME", analytics: true, analyticsCaptureOutgoing: true, logBody: 'all' });
For more advanced options on installing your monitoring code, view customizing agent.
Build and Start your NestJS server.
Just restart your server and access it from your web app or mobile app or curl. You will visualize your application's metrics within minutes.
Important:
The statement
import * as atatus from 'atatus-nodejs'
should be the first line of your server code and placed above all other 'import' statements. Otherwise instrumentation will not work.