Skip to content

Add structured log for database query exceeding 200ms response time #612

Description

@Chucks1093

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

  • Warning log emitted when query exceeds threshold
  • Log not emitted for queries below threshold
  • All four fields present in the log
  • Query parameters absent from log output
  • Threshold configurable via environment variable

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions