Uh oh!
There was an error while loading. Please reload this page.
feat: Mongoose tracing support added to MongoDB - #3252
Conversation
kamilogorek
commented
Feb 17, 2021
Awesome, thanks! :) |
* Add flag to switch to mongoose as the wrapped mongo library
derekrprice
commented
May 14, 2021
I tried this with @sentry/node and @sentry/tracing 6.3.0 with serverless functions and still am not seeing Mongo traces in my transactions. Is this feature released? |
kamilogorek
commented
May 18, 2021
@derekrprice can you provide an example of how you instrument your serverless functions? Basically how you instantiate a trace and attach spans in your pipeline. (I've seen your support discussion, but I think it'll be quicker to discuss it here) |
Here is my entire instrumentation. We use this module as a higher order function (HOF) to wrap several different serverless functions, like so: Here is the actual implementation of |
derekrprice
commented
May 19, 2021
Nevermind, I've solved this. I had to move the |
derekrprice
commented
May 19, 2021
derekrprice
commented
May 19, 2021
|
kamilogorek
commented
May 19, 2021
It is global, unless used inside |
derekrprice
commented
May 19, 2021
This is the new version of my Every new serverless function call should have its own |
derekrprice
commented
May 19, 2021
A PR doesn't seem like the right place to continue this discussion, so I opened bug report #3572 |


After this PR, Mongo tracing for projects using Mongoose should function as expected by initializing Sentry with the following:
This works because the
Collectionmethods frommongodbare applied toNativeCollectiononmongoose(which can be accessed atmongoose.Collection) See: https://github.com/Automattic/mongoose/blob/master/lib/drivers/node-mongodb-native/collection.js#L15-L22Fixes#3176