dd-trace-js
dd-trace-js copied to clipboard
feat: mariadb plugin and instrumentation
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
- [x] Unit tests.
- [x] TypeScript definitions.
- [x] TypeScript tests.
- [x] API documentation.
- [x] CircleCI jobs/workflows.
- [x] Plugin is exported.
Additional Notes
I'm not clear about what, if anything, I need to do regarding CircleCI.
I've tested the Connection wrapping locally and it doesn't appear to work.
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.
@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.
I rebased and linted, but I still don't see the mariadb plugin tests running
@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
.
@jamiehodge Looks like tests are still failing.
Yes, I wasn't able to figure out how to require the versioned "mariadb/callback" ("mariadb" returns the promise api).
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')
.
OK.. The tests are now running, but they are timing out, as the assertions appears to not be met (done is never called).
@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.