sentry-javascript
sentry-javascript copied to clipboard
Node MySQL2 Integration
An integration is available from @sentry/tracing for the node mysql module but not mysql2. The module APIs are nearly identical and I would hope this would be easy to enable.
Yeah, I'd be interested in this too. I'd be happy to implement it if there's a rough guide somewhere to building these sorts of tracing integrations?
Looking at the source code, it's heavily dependant on loading a specific file & then monkey-patching a method?
https://github.com/getsentry/sentry-javascript/blob/c0089b58dc493c7f2e57dbc7a7f496598c6b8683/packages/tracing/src/integrations/mysql.ts#L25
Looking at the source code, it's heavily dependant on loading a specific file & then monkey-patching a method?
That's exactly how it works. We need however, work on extracting all these into a separate packages, as loading them for everyone is not optimal right now.
@kamilogorek the file is tiny and the different between mysql/mysql2 is almost none, they both have a connection.js with the only difference being that mysql2 is passing an additional config parameter,
See pr #3661
@jpike88 Nice! That mysql2.ts file in your PR is literally what I've done to add support to my Sentry instance, so far working really well!
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
I, for one, would still be excited to see this. Looks like that PR just got closed without merging. What happened?
+1 for support on this as i use mysql2
We should support this now via OTEL - please re-open if I am wrong. https://docs.sentry.io/platforms/node/performance/instrumentation/opentelemetry/
I'm not sure as of why it's still not supported with a simple integration. On my side, i know nothing about open telemetry, and it seems to be a whole new thing to explore and integrate (as the docs say, we need to instantiate lot of things, install lots of packages for it to work).
Is it really mandatory to install all of that even today ?
Same here. Why is there no “official” version. I had a custom integration that broke with one of the last updates - although it was a minor one 😔
We are working on a revamped node SDK which uses OpenTelemetry under the hood for tracing right now. This will support mysql2 out of the box, without any custom OpenTelemetry setup. We'll keep you posted when this becomes stable enough to try it out!
Hi , any update on this. Any estimated dates on when this will be available in nodejs sdk. Thanks in advance :)
We are planning to release v8 of the SDK around the end of January which will include the move to OpenTelemetry. Once that is done, we will have support for mysql2.
Hi, Just wondering whether this is still on track for around now?
+1
I recently added some integration tests for @sentry/node-experimental that test mysql2. The node experimental package uses OpenTelemetry for its auto-instrumeted span creation.
When v8 of the JavaScript packages ships, otel will be the default for auto-instrumentation on node.
+1 -- this is a missing piece for us with Sentry!
+1 -- this is a missing piece for us with Sentry!
Have you tried the latest beta release? mysql2 is supported in v8.
v8 is out and should have proper mysql2 support! 🎉