next.js – How to start Nextjs application with NewRelic agent?

I have installed Newrelic agent on my Nextjs app.
So far I have done the following on my nextjs app:

npm install @newrelic/next

I then copied the newrelic.js file to my root folder. I added my license key and my app name in that file.

I also update the package.json file with newrelic in the profile to run:

"scripts": {    
    "dev-k8": "NODE_OPTIONS='-r @newrelic/next' next dev -p 3000", 
    "lint": "next lint"
  },

I then start my Nextjs app as :
npm run dev-k8

It starts fine. But I don’t see any trace or events in my NewRelic for the browser app.

Am I doing this right?

Read more here: Source link