sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Node MySQL2 Integration

Open derekrprice opened this issue 4 years ago • 18 comments

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.

derekrprice avatar Apr 21 '21 14:04 derekrprice

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

jdrydn avatar Jun 03 '21 19:06 jdrydn

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 avatar Jun 04 '21 18:06 kamilogorek

@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 avatar Jun 09 '21 13:06 jpike88

@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!

jdrydn avatar Jun 09 '21 16:06 jdrydn

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 🥀

github-actions[bot] avatar Oct 14 '21 12:10 github-actions[bot]

I, for one, would still be excited to see this. Looks like that PR just got closed without merging. What happened?

derekrprice avatar Oct 14 '21 12:10 derekrprice

+1 for support on this as i use mysql2

RedSpid3r avatar Jun 08 '22 13:06 RedSpid3r

We should support this now via OTEL - please re-open if I am wrong. https://docs.sentry.io/platforms/node/performance/instrumentation/opentelemetry/

HazAT avatar Jan 25 '23 17:01 HazAT

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 ?

Luxiorawa avatar Oct 20 '23 12:10 Luxiorawa

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 😔

pkyeck avatar Oct 21 '23 08:10 pkyeck

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!

mydea avatar Oct 23 '23 07:10 mydea

Hi , any update on this. Any estimated dates on when this will be available in nodejs sdk. Thanks in advance :)

shijo-keyvalue avatar Dec 26 '23 06:12 shijo-keyvalue

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.

lforst avatar Dec 27 '23 08:12 lforst

Hi, Just wondering whether this is still on track for around now?

salonmonster avatar Jan 30 '24 18:01 salonmonster

+1

JustDoItSascha avatar Jan 30 '24 19:01 JustDoItSascha

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.

timfish avatar Jan 30 '24 23:01 timfish

+1 -- this is a missing piece for us with Sentry!

tim-helloquickly avatar May 03 '24 14:05 tim-helloquickly

+1 -- this is a missing piece for us with Sentry!

Have you tried the latest beta release? mysql2 is supported in v8.

timfish avatar May 03 '24 15:05 timfish

v8 is out and should have proper mysql2 support! 🎉

mydea avatar May 15 '24 12:05 mydea