Install Atatus Node.js package.
copynpm install --save atatus-nodejs
You need to add
NODE_OPTIONS='-r atatus-nodejs/start'
to enable Atatus auto instrumentation for the Nuxt.js backend. If you start your Nuxt.js app usingpackage.json
, you can update yourdev
andstart
npm scripts as follows:// package.json { "scripts": { "dev": "NODE_OPTIONS='-r atatus-nodejs/start' nuxt dev", "build": "nuxt build", "start": "NODE_OPTIONS='-r atatus-nodejs/start' nuxt start", "lint": "nuxt lint" } }
If you use any other startup script (e.g pm2), add
NODE_OPTIONS
accordingly.You can set license key and app name either in
ENV variables
oratatus-config.js
.a) 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"
b) atatus-config.js
This file should in the directory where you run your Nuxt.js server.
copy// atatus-config.js module.exports = { licenseKey: "YOUR_LICENSE_KEY", appName: "YOUR_APP_NAME", analytics: true, analyticsCaptureOutgoing: true, logBody: "all" }
If this file is not found, you will get the error "License key is missing!". To fix this error, you can set the path of atatus-config.js in the env variable as follows
copyexport ATATUS_CONFIG_FILE=/path/to/atatus-config.js
Restart your Nuxt.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 Nuxt.js apps in Atatus
- COMPARE
- Company