Kibana version: 7.2.0
Elasticsearch version: 7.2.0
APM Server version: 7.2.0
APM Agent language and version: elastic-apm-node 2.17.X
Original install method (e.g. download page, yum, deb, from source, etc.) and version: From npm package
Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
I use mongodb (https://www.npmjs.com/package/mongodb) npm package to connect to my database. Although I am using the latest version with elastic-apm-node, I can see the express HTTP calls, but no DB spans.
The top of the application is inside a www file and we did include the start() there. It sees all the HTTP requests, but no MongoDB queries. Moving the start elswere has no effect. Even adding a custom span around a DB query doesn't intercept the mongodb query.
The only special thing I see is that models are used to represent mongodb documents. Hence, instead of calling the driver directly, we abstract it behind a model. It shouldn't stop the APM agent from seeing the call anyway.
EDIT: We use the MongoClient object from mongodb llibrary
Errors in browser console (if relevant): None
Provide logs and/or server output (if relevant):
| setting default transaction name: POST /login { trans: 'df537a6y56y35523',
| parent: undefined,
| trace: '5ecc84e8426fghfghfghfghfg2d58a7ebe1' }
| sending transaction { trans: 'df537a6y56y35523',
| trace: '5ecc84e8426fghfghfghfghfg2d58a7ebe1' }
| ended transaction { trans: 'df537a6y56y35523',
| parent: undefined,
| trace: '5ecc84e8426fghfghfghfghfg2d58a7ebe1',
| type: 'request',
| result: 'HTTP 2xx',
| name: 'POST /login' }
| no active transaction found - cannot build new span
| intercepted call to http.request { id: null }
We don't see mongodb being intercepted at all