首页 > 解决方案 > 弹性 APM HTTP 错误 (404):找不到 404 页面

问题描述

在 Node Express 应用程序中集成 Elastic APM 时出错。
节点js:v6.4.2,

应用程序.js

require('elastic-apm-node').start({
  serviceName: config.apm_node.SERVICE_NAME,
  secretToken: config.apm_node.SECRET_TOKEN,
  serverUrl: config.apm_node.SERVER_URL,
  environment: config.apm_node.ENV,
});

包.json

"elastic-apm-node":"^1.14.4"

错误:

您触发了 unhandledRejection,您可能忘记捕获 Promise 拒绝:错误:发送后无法设置标头。在 ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11) 在 /home/ubuntu/depanels/server/api/user/user.controller.js:22:25 在 /home/ubuntu/depanels/server/auth/ auth.service.js:149:28 at _fulfilled (/home/ubuntu/depanels/node_modules/q/q.js:854:54) at self.promiseDispatch.done (/home/ubuntu/depanels/node_modules/q/q .js:883:30) 在 Promise.promise.promiseDispatch (/home/ubuntu/depanels/node_modules/q/q.js:816:13) 在 /home/ubuntu/depanels/node_modules/q/q.js:624 :44 在 runSingle (/home/ubuntu/depanels/node_modules/q/q.js:137:13) 在刷新 (/home/ubuntu/depanels/node_modules/q/q.js:125:

请建议我在哪里做错了?

标签: node.jsexpresselasticsearchelastic-stackapm

解决方案


推荐阅读