在 Nuxtjs 项目中配置/启用 Elastic APM 代理的正确方法是什么?
我为自定义 NodeJS 应用程序引用了此文档。关键的收获是:
重要的是,在您需要 Node.js 应用程序中的任何其他模块之前启动代理 - 即在 http 之前和路由器之前等。
我在 nuxt.config.js 中添加了以下代码段,但 APM 代理没有启动或工作。我在应用程序日志中看不到任何错误。
var apm = require('elastic-apm-node').start({
serviceName: 'nuxt-app',
serverUrl: 'http://ELK_APM_SERVER:8200'
})
有没有其他方法可以做到这一点?