Summary
Slow database queries are currently invisible until they surface as high API latency. A warning log should be emitted whenever a query takes longer than 200ms so slow queries can be identified and optimised before they impact users.
Scope
- Instrument the database query layer to measure query duration
- Emit a warn-level log when duration exceeds 200ms with fields:
query_name, duration_ms, table, operation (select/insert/update/delete)
- Log should not include query parameters to avoid leaking sensitive data
- Threshold should be configurable via an environment variable defaulting to 200
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
Slow database queries are currently invisible until they surface as high API latency. A warning log should be emitted whenever a query takes longer than 200ms so slow queries can be identified and optimised before they impact users.
Scope
query_name,duration_ms,table,operation(select/insert/update/delete)Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram