Skip to content

Improve mysql2 instrumentation#948

Open
timokoessler wants to merge 11 commits into
mainfrom
fix-mysql2
Open

Improve mysql2 instrumentation#948
timokoessler wants to merge 11 commits into
mainfrom
fix-mysql2

Conversation

@timokoessler
Copy link
Copy Markdown
Member

@timokoessler timokoessler commented Feb 26, 2026

  • Fix pool instrumentation
  • Fix context confusion when using pool under higher concurrency
  • Fix missing instrumentation of .prepare function

Summary by Aikido

Security Issues: 0 Quality Issues: 0 Resolved Issues: 0

⚡ Enhancements

  • Added prepare instrumentation and hooked prepare into SQL inspection
  • Added warning for outdated mysql2 versions and version check logic
  • Updated tests to cover pools, prepare, context propagation, and warnings
  • Added mysql2 v3.18 devDependency rewrite entry in package.json

🐛 Bugfixes

  • Fixed pool instrumentation and ensured context propagation under concurrency

🔧 Refactors

  • Introduced helper to extract SQL and params from various argument shapes

More info

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2026

Codecov Report

❌ Patch coverage is 97.09302% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
library/sinks/MySQL2.ts 97.09% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread library/sinks/MySQL2.tests.ts
Comment thread library/sinks/MySQL2.tests.ts
Comment thread library/sinks/MySQL2.tests.ts Outdated
Comment thread library/sinks/MySQL2.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant