elastic / elastic/apm-agent-nodejs
MongoDB Span doesn't have the correct MongoDB command name
- Dominant language
- JavaScript
- Stars
- 594
- Forks
- 244
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 16
Description
**Describe the bug**
The MongoDB span is not always showing the correct command i.e. `find` instead of `findOne`
**Expected behavior**
To show the same MongoDB command as is being used.
**Environment (please complete the following information)**
- OS: Linux
- Node.js version: 12
- APM Server version: 3.2.0
- MongoDB version: 3.4.0
**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`
**Additional context**
In the image below the span name starting with `MongoDB` is a span we manually added which shows the correct MongoDB command `findOne`

Contributor guide
Assessment
This issue has not been assessed yet.