/** * Auto-instrumentation for popular Node.js database libraries. * * Captures per-query details: masked query string, execution time, duration, source. * * Supported libraries: * - pg (node-postgres) — Client.query, Pool.query * - mysql2 — Connection.query/execute, Pool.query/execute * - mongoose / mongodb driver — Collection methods (find, insertOne, etc.) * - ioredis — Commander.sendCommand * - knex — Client.query * - prisma (@prisma/client) — PrismaClient._request * - better-sqlite3 — Database.prepare().run/get/all * - sequelize — Sequelize.query * * Not independently patched, but captured anyway (same reasoning as Knex/ * Prisma/Sequelize above — see suppressNestedRecording): Drizzle ORM, when * used via drizzle-orm/node-postgres, drizzle-orm/mysql2, or * drizzle-orm/better-sqlite3 — each of those drivers calls straight into * the already-patched pg/mysql2/better-sqlite3 methods under the hood. * Verified empirically, 2026-10-06. drizzle-orm/postgres-js (the `postgres` * package) is NOT yet covered — it has no shared prototype to patch (every * client is built from closures), so it would need a require-cache-level * patch instead of the prototype patches used everywhere else here. */ /** Wrap a sync/async/callback-style method to capture query details. Exported for direct unit testing. */ export declare function wrapMethod(obj: Record, method: string, source: string, queryExtractor?: (args: unknown[]) => string): void; export interface InstrumentResult { patched: string[]; total: number; } /** * Auto-detect and patch all installed database libraries. * Called once when the middleware initializes. */ export declare function autoInstrument(includeOutbound?: boolean): InstrumentResult; //# sourceMappingURL=instrument.d.ts.map