Install Atatus Node.js package.
copynpm install --save atatus-nodejsYou need to add
NODE_OPTIONS='-r atatus-nodejs/start-next.js'to enable Atatus auto instrumentation for the Next.js backend. If you start your Next.js app usingpackage.json, you can update yourdevandstartnpm scripts as follows:// package.json { // ... "scripts": { "dev": "NODE_OPTIONS='-r atatus-nodejs/start-next.js' next dev", "build": "next build", "start": "NODE_OPTIONS='-r atatus-nodejs/start-next.js' next start", "lint": "next lint" }, // ... }If you use any other startup script (e.g pm2), add
NODE_OPTIONSaccordingly.For example:
NODE_OPTIONS='-r atatus-nodejs/start-next.js' next startSet the license key and app name using environment variables:
export ATATUS_LICENSE_KEY="YOUR_LICENSE_KEY" export ATATUS_APP_NAME="YOUR_APP_NAME" export ATATUS_ANALYTICS=true export ATATUS_ANALYTICS_CAPTURE_OUTGOING=true export ATATUS_LOG_BODY="all"Restart your Next.js 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.
Docs Menu
Monitor your Next.js apps in Atatus
- COMPARE
- Company
+1-415-800-4104