newrelic / node-newrelic

New Relic Node.js agent code base. Developers are welcome to create pull requests here, please see our contributing guidelines. For New Relic technical support, please go to http://support.newrelic.com.
Apache License 2.0
971 stars 399 forks source link

Mongoose Support #526

Open michaelgoin opened 4 years ago

michaelgoin commented 4 years ago

On behalf of @monitorjain

Unable to leverage distributed tracing patterns for a business critical app. This stops the SREs/Ops Support Team to execute effective RCA exercises and creates a blind spot in the key transactions' observability.

Sequelize has been split into own issue: https://github.com/newrelic/node-newrelic/issues/957

Feature Description

Out of the box support for Sequelize ORM module and Mongoose DB.

Additional context

Priority

Please help us better understand this feature request by choosing a priority from the following options: Blocker We have experienced some incompatibilities and mismatch between API throughput and database throughput when we load the service using Apache bench with 500 & 1000 concurrent requests. This suspectedly happens when distributed tracing is turned off. In either setup (DT - on, DT - off), we are unable to track the sequelize ORM database calls

[Edited by New Relic]

Your expert opinion and help is highly appreciated.

michaelgoin commented 4 years ago

Thank you for the feature requests. These have been noted by our Product Manager.

In both of these cases, I'm assuming it will mostly be a matter of adding instrumentation to ensure transaction state is maintained to see the underlying database call for a module we already instrument (mongodb, mysql, pg, etc.). If there are any specific calls specific to either of these libraries you think we also be good to measure, let us know. We'll also dig into these further at the point by which we go to add support.

In the meantime, custom instrumentation will likely be the best route. I understand based on your alternatives above it does not sound pragmatic to use the Agent API (1000+ controllers). We also have our instrumentation ("shim") API which can be used. It is how external module instrumentation is built. It is not as straightforward but may be an option in a pinch. We have some writeups/examples along with API documentation here: http://newrelic.github.io/node-newrelic/docs/tutorial-Context-Preservation.html and our various instrumentation modules will show how they are used. This may be a bit more effort than you want to take on but wanted to share as an option for the meantime.

michaelgoin commented 3 years ago

https://discuss.newrelic.com/t/feature-idea-fully-support-mongoose-in-node-js-agent/74289

bizob2828 commented 4 months ago

may still be valid, we can make a test app to see

workato-integration[bot] commented 4 months ago

https://new-relic.atlassian.net/browse/NR-292125