The Node.js SDK wraps standard MongoDB and PostgreSQL node drivers to intercept database operations.
Basic configuration
import { initTraceMole } from "@tracemole/node";
initTraceMole({
apiKey: process.env.TRACEMOLE_API_KEY,
thresholdMs: 100, // profile queries taking longer than 100ms
sampleRate: 1.0 // collect all occurrences
});Ensure that initTraceMole() is invoked at the very beginning of your application entry point file (e.g. index.ts or server.ts) before any database drivers are imported.