-
Notifications
You must be signed in to change notification settings - Fork 294
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
Issues with mysql2/promise #132
Comments
@rochdev Thanks for your quick reply. I already got it to work with mysql2 plugin disabled, but wasn't sure if I did something wrong. I will wait for |
It seems this bug actually affects even the callback based version. It doesn't happen when For example: require('mysql2/promise') // require before to work around the bug
const tracer = require('dd-trace').init()
const mysql2 = require('mysql2/promise') // require again to apply patching |
It doesn't crash now, but I also get no traces of my mysql2 queries. |
@derN3rd It should still be instrumented in external modules if the external module is required after the tracer is initialized. Could you try something like this: require('mysql2') // require callback version to avoid race condition with promise patch
const tracer = require('dd-trace').init()
const externalModule = require('external-module') Also make sure you have re-enabled the plugin. |
@rochdev Thanks man. Thanks for the help |
Hey there,
We are using the mysql2 module with
require('mysql2/promise')
which causes the patch to fail:Node version: 8.4.0
dd-trace-js version: ^2.1.0
mysql2 version: ^1.5.2
I'm sure this has something todo with the Promise stuff from mysql2.
Is there any way I can use this module without rewriting my whole code?
Thanks in advance
The text was updated successfully, but these errors were encountered: