Description — what to implement and the why/impact.
As the Astroid financial operating system processes high volumes of agent transactions and wallet audit logs, database performance is critical. Currently, slow or unoptimized queries are not systematically tracked or measured in production. This issue implements a NestJS interceptor or Prisma middleware that logs query execution duration and flags queries exceeding a configurable threshold for database performance tuning.
Context & Requirements — background, constraints, design references, edge cases;
- Located in
src/database or src/common/interceptors.
- Utilize Prisma query events or middleware to measure execution time per query.
- Log structured warnings with query parameters (sanitized) when duration exceeds the threshold (e.g., > 250ms).
- Integrate with NestJS Logger service.
Acceptance Criteria — a checklist ("- [ ] ...") of specific, testable conditions that define "done".
Implementation Guidance — likely files/modules to touch and a suggested approach
- Likely touch
src/database/database.service.ts or create a new Prisma extension file under src/database/.
- Ensure sensitive parameters in query args are masked or omitted in logs.
Testing & Validation — how the contributor should prove it works
- Run
npm test to verify no regressions.
- Add unit tests mocking Prisma query execution with high latency.
Submission Guidelines — must open a PR that includes "Closes #"; assignment is required before starting; follow the repo's existing style and conventions.
Wave complexity: Medium
Description — what to implement and the why/impact.
As the Astroid financial operating system processes high volumes of agent transactions and wallet audit logs, database performance is critical. Currently, slow or unoptimized queries are not systematically tracked or measured in production. This issue implements a NestJS interceptor or Prisma middleware that logs query execution duration and flags queries exceeding a configurable threshold for database performance tuning.
Context & Requirements — background, constraints, design references, edge cases;
src/databaseorsrc/common/interceptors.Acceptance Criteria — a checklist ("- [ ] ...") of specific, testable conditions that define "done".
Implementation Guidance — likely files/modules to touch and a suggested approach
src/database/database.service.tsor create a new Prisma extension file undersrc/database/.Testing & Validation — how the contributor should prove it works
npm testto verify no regressions.Submission Guidelines — must open a PR that includes "Closes #"; assignment is required before starting; follow the repo's existing style and conventions.
Wave complexity: Medium