-
-
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
Mongoose instrumentation does not work for Mongoose >= 7 #11499
Comments
Assigning to @getsentry/support for routing ⏲️ |
Hey @jennyunh thanks for writing in!
We're currently working on the next SDK major version (v8) which should increase the quality of our express and DB integration spans because we're using OpentTelemetry instrumentation. Currently, we're still in an alpha state but we're targetting a beta in the next days. Might be worth checking out to see if this behaviour resolved itself. |
Thanks for the information. I don't see anything concretely wrong with this setup on first glance. Have you tried turning on Another idea: Are you initializing the SDK as early as possible in your application lifecycle? I suggest calling Sentry.init before you require mongoose/express. I still think that this is probably already fixed in v8 so (assuming there's a bug) I don't think we'll get to fix this for v7 in the immediate future. If you want to get a headstart on updating, our latest v8 alpha is fairly stable by now and we don't expect breaking changes in a conventional SDK setup anymore. However, I can ofc understand that updating to an alpha is scary, so no worries :) |
Upon turning on If this is a bug in v7, then I will try upgrading to v8 after its release at a later time. |
We'll get a beta build out this week. After that our main focus is ensuring data quality so it'd actually be super helpful for us if you could give the beta a try and report if you now get the missing DB spans. Depending on community feedback around bugs/quality, the beta period can be shorter or longer. Can't give you an ETA on a stable release, yet. |
We have v8.0.0 out, so you can try it out in the stable version today! |
What version of mongoose are you running? We're seeing the same issue with Sentry v8 since opentelemetry doesn't support mongoose v7/v8 and since Sentry relies fully on that in Sentry v8 (From my understanding) this breaks the mongoose integration for anyone running a mildly modern version of Mongoose. |
Out of curiosity, did mongoose v7/v8 work in Sentry v7? You did the best thing to move this forward already, which is to leave a comment and show interest upstream in open-telemetry/opentelemetry-js-contrib#1606 - we'll also keep an eye on this, maybe we can help bringing support for newer mongoose versions too! |
You're right, it didn't! When I check again the spans we're seeing when using 7.x are from the mongo integration. These have disappeared in 8.x. I'll raise a separate issue for that. Edit: I raised open-telemetry/opentelemetry-js-contrib#2218 to get some clarity into how to get the mongodb integration to work. Edit2: Actually when I take a second look at the screenshot in the issue here I see the same thing we're experiencing, db transactions were present before but no longer so it's possible that @jennyunh is seeing the same issue related to the mongodb integration and not mongoose. You can see which integration it comes from by clicking one of the spans and checking the right panel for |
Great findings! So I guess more stuff to fix upstream 😅 We're putting this on our agenda to try to get these things fixed/updated in opentelemetry 🤞 |
Great to hear! Do you want me to create a separate issue for the mongo problem or are you tracking both of those with this one or should I wait until I get a reply in open-telemetry/opentelemetry-js-contrib#2218 ? |
Feel free to open a separate issue, does not hurt to track this here as well - thank you! |
As an update - @onurtemizkan opened a PR for this here: open-telemetry/opentelemetry-js-contrib#2353 we are waiting on reviews. |
open-telemetry/opentelemetry-js-contrib@770130a Once we update the dep, we need to update the docs for supported versions. |
…13587) This bumps all our internal OTEL instrumentation to their latest version. Mainly, this fixes two things: * Mongoose now supports v7 & v8 open-telemetry/opentelemetry-js-contrib#2353 * A variety of bug fixes, including a problem with http.get in ESM mode open-telemetry/opentelemetry-js#4857 - See: https://github.com/open-telemetry/opentelemetry-js/releases/tag/experimental%2Fv0.53.0 Related: * open-telemetry/opentelemetry-js#4975 Issue about relaxing deps in "core" instrumentation packages * PR to bump deps in `@prisma/instrumentation`: prisma/prisma#25160 * PR to bump deps in `opentelemetry-instrument-remix`: justindsmith/opentelemetry-instrumentations-js#52 * PR to bump deps in `opentelemetry-instrumentation-fetch-node`: gas-buddy/opentelemetry-instrumentation-fetch-node#17 (which will also be superseded by #13485 eventually) * Closes #11499
This has been released with https://github.com/getsentry/sentry-javascript/releases/tag/8.29.0, the sdk now supports mongoose v8! |
Unfortunately, I'm still seeing this error with Sentry |
Environment
SaaS (https://sentry.io/)
What are you trying to accomplish?
I've added in the appropriate database integrations to see db queries in my transactions:
https://docs.sentry.io/platforms/node/performance/database/
How are you getting stuck?
Database queries are not being detected and showing up for some transactions.
Sentry initialization:
No db queries:
Has db queries:
Where in the product are you?
Performance
Link
No response
DSN
https://524f54dda82743f3445b4f28533ef38d@o4505830066159616.ingest.sentry.io/4505869944881152
Version
No response
The text was updated successfully, but these errors were encountered: