2

Getting error while integrating Elastic APM in the Node Express application.
Nodejs: v6.4.2,

app.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,
});

package.json

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

Error:

You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection: Error: Can't set headers after they are sent. at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:335:11) at /home/ubuntu/depanels/server/api/user/user.controller.js:22:25 at /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) at Promise.promise.promiseDispatch (/home/ubuntu/depanels/node_modules/q/q.js:816:13) at /home/ubuntu/depanels/node_modules/q/q.js:624:44 at runSingle (/home/ubuntu/depanels/node_modules/q/q.js:137:13) at flush (/home/ubuntu/depanels/node_modules/q/q.js:125:13) at elasticAPMCallbackWrapper (/home/ubuntu/depanels/node_modules/elastic-apm-node/lib/instrumentation/index.js:191:27) at nextTickCallbackWith0Args (node.js:419:9) at process._tickDomainCallback [as _tickCallback] (node.js:389:13) Elastic APM HTTP error (404): 404 page not found Elastic APM HTTP error (404): 404 page not found

Please suggest where I am doing wrong?

Sanjeet kumar
  • 3,333
  • 3
  • 17
  • 26

0 Answers0