Skip to content

Improve mysql2 instrumentation#948

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

Improve mysql2 instrumentation#948
timokoessler wants to merge 14 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: 4 Resolved Issues: 0

⚡ Enhancements

  • Added instrumentation support for prepare and execute methods on connections
  • Added version check and warning for outdated mysql2, bumped test dependency
  • Expanded tests to cover pools, callbacks, prepare, execute, and warning behavior

🐛 Bugfixes

  • Fixed pool instrumentation and context leaks under higher concurrency during queries

🔧 Refactors

  • Refactored query inspection to extract SQL and parameters from arguments

More info

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 26, 2026

Codecov Report

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

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

📢 Thoughts on this report? Let us know!

Comment thread library/sinks/MySQL2.tests.ts
Comment thread library/sinks/MySQL2.tests.ts Outdated
Comment thread library/sinks/MySQL2.ts
functions: this.getFunctionInstructions(),
functions: this.getConnectionFunctionInstructions(),
accessLocalVariables: {
names: ["globalThis"], // Placeholder to run code on file load
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's maybe add task to improve this later?

Comment thread library/sinks/MySQL2.tests.ts
Comment thread library/sinks/MySQL2.tests.ts
Comment thread library/sinks/MySQL2.ts
Comment thread library/sinks/MySQL2.tests.ts
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.

2 participants