apm-agent-nodejs icon indicating copy to clipboard operation
apm-agent-nodejs copied to clipboard

Fastify-cli compatibility

Open pc3b3r opened this issue 5 years ago • 0 comments

Describe the bug Using https://github.com/fastify/fastify-cli generator, the server is starting with the start script on package.json and the app is loaded as a plugin (app.js). APM should be on the top of the Fastify module but, considering it's a dependency, it's not possible to add it. Putting it on the top of the plugin (app.js) doesn't work.

To Reproduce

Steps to reproduce the behavior:

  1. Use this config (on app.js)
require('elastic-apm-node').start({
  //MY PARAMS
  logLevel: 'trace'
})
  1. Then call 'npm start'
  2. See no shimming logs

Expected behavior

Start APM agent for Fastify

Environment (please complete the following information)

  • OS: [e.g. Linux]
  • Node.js version: 12.13.1
  • APM Server version: 7.6.1
  • Agent version: Fastify

How are you starting the agent? (please tick one of the boxes)

  • [X] Calling agent.start() directly (e.g. require('elastic-apm-node').start(...))
  • [ ] Requiring elastic-apm-node/start from within the source code
  • [ ] Starting node with -r elastic-apm-node/start

pc3b3r avatar Apr 03 '20 14:04 pc3b3r