elastic / elastic/apm-agent-nodejs

Fastify-cli compatibility

Open
#1,707 0 comments 0 reactions 0 assignees View on GitHub
agent-nodejs enhancement
Dominant language
JavaScript
Stars
594
Forks
244
Avg merge
1d 8h
Merged PRs (30d)
16

Description

**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)
```js
require('elastic-apm-node').start({
//MY PARAMS
logLevel: 'trace'
})
```
2. Then call 'npm start'
3. 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`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.