-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Mongoose tracing support added to MongoDB #3252
Conversation
Awesome, thanks! :) |
* Add flag to switch to mongoose as the wrapped mongo library
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? |
@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
|
Nevermind, I've solved this. I had to move the |
|
It is global, unless used inside |
This is the new version of my
Every new serverless function call should have its own |
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
Collection
methods frommongodb
are applied toNativeCollection
onmongoose
(which can be accessed atmongoose.Collection
) See: https://github.com/Automattic/mongoose/blob/master/lib/drivers/node-mongodb-native/collection.js#L15-L22Fixes #3176