How do you properly set up and activate an Elastic APM agent in a Nuxt.js project?
I followed the instructions from this documentation for a custom Node.js app. The main point emphasized was:
It's crucial to start the agent before loading any other modules in your Node.js application - including http and router.
Even though I added the code snippet below in nuxt.config.js, the APM agent isn't starting or functioning. No errors are appearing in the app logs either.
var apm = require('elastic-apm-node').start({
serviceName: 'nuxt-app',
serverUrl: 'http://ELK_APM_SERVER:8200'
})
Is there an alternative method to achieve this?