dd-trace-js icon indicating copy to clipboard operation
dd-trace-js copied to clipboard

feat: mariadb plugin and instrumentation

Open jamiehodge opened this issue 2 years ago • 10 comments

What does this PR do?

Add mariadb instrumentation and plugin.

Motivation

The package is a good alternative to the mysql and mysql2 packages.

Plugin Checklist

Additional Notes

jamiehodge avatar Jun 23 '22 11:06 jamiehodge

I'm not clear about what, if anything, I need to do regarding CircleCI.

jamiehodge avatar Jul 07 '22 08:07 jamiehodge

I've tested the Connection wrapping locally and it doesn't appear to work.

jamiehodge avatar Jul 07 '22 08:07 jamiehodge

I've tested the Connection wrapping locally and it doesn't appear to work.

What error are you getting? Tried to quickly get it to run locally but I get an error from npm that seems unrelated.

rochdev avatar Jul 11 '22 16:07 rochdev

@jamiehodge Sorry for the delay, took a look and it LGTM. A quick rebase and fixing linter errors and we should be able to merge and release this soon.

rochdev avatar Aug 17 '22 00:08 rochdev

I rebased and linted, but I still don't see the mariadb plugin tests running

jamiehodge avatar Aug 17 '22 12:08 jamiehodge

@jamiehodge It did run: https://github.com/DataDog/dd-trace-js/runs/7881608840?check_suite_focus=true

However, it uses the mysql test wait script, which in turn requires mysql be installed. The easiest way to solve this with the current test suite is to add mariadb in the list for the mysql job instead of in its own job, so basically PLUGINS=mysql|mysql2|mariadb.

rochdev avatar Aug 17 '22 16:08 rochdev

@jamiehodge Looks like tests are still failing.

rochdev avatar Aug 18 '22 19:08 rochdev

Yes, I wasn't able to figure out how to require the versioned "mariadb/callback" ("mariadb" returns the promise api).

jamiehodge avatar Aug 18 '22 19:08 jamiehodge

Yes, I wasn't able to figure out how to require the versioned "mariadb/callback" ("mariadb" returns the promise api).

That would be with require(`../../../versions/mariadb@${version}`).get('mariadb/callback').

rochdev avatar Aug 18 '22 19:08 rochdev

OK.. The tests are now running, but they are timing out, as the assertions appears to not be met (done is never called).

jamiehodge avatar Aug 19 '22 13:08 jamiehodge

@jamiehodge Thanks for all the work in this PR. We are refactoring our plugins right now to make them simpler and I took the opportunity to move the code from this PR to #2428 and make the necessary changes at the same time.

rochdev avatar Oct 06 '22 18:10 rochdev