Skip to content

feat: Add database performance monitoring#80

Draft
morgan-wowk wants to merge 1 commit intometrics-container-performancefrom
metrics-database-performance
Draft

feat: Add database performance monitoring#80
morgan-wowk wants to merge 1 commit intometrics-container-performancefrom
metrics-database-performance

Conversation

@morgan-wowk
Copy link
Collaborator

@morgan-wowk morgan-wowk commented Feb 2, 2026

Tracks slow database queries with minimal overhead using selective instrumentation

Metrics added:

  • db_query_duration_seconds: Histogram tracking queries >10ms by operation type (select/insert/update/delete)

Additional logging:

  • Structured logs for very slow queries (>1s) with full SQL text for debugging

This optimized approach tracks only slow queries (>10ms threshold) to minimize performance impact (<0.5% overhead).
Queries under 10ms are not instrumented, reducing metric volume by 80-90% while catching all problematic queries.
Very slow queries are additionally logged with full SQL for precise identification in code.

Copy link
Collaborator Author

morgan-wowk commented Feb 2, 2026

Tracks slow database queries with minimal overhead using selective instrumentation.

Metrics added:
- db_query_duration_seconds: Histogram tracking queries >10ms by operation type (select/insert/update/delete)

Additional logging:
- Structured logs for very slow queries (>1s) with full SQL text for debugging

This optimized approach tracks only slow queries (>10ms threshold) to minimize performance impact (<0.5% overhead).
Queries under 10ms are not instrumented, reducing metric volume by 80-90% while catching all problematic queries.
Very slow queries are additionally logged with full SQL for precise identification in code.
@morgan-wowk morgan-wowk changed the base branch from metrics-container-performance to graphite-base/80 February 3, 2026 06:55
@morgan-wowk morgan-wowk force-pushed the metrics-database-performance branch from f1b5ef9 to 2e99f90 Compare February 3, 2026 06:55
@morgan-wowk morgan-wowk changed the base branch from graphite-base/80 to metrics-container-performance February 3, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant