Instrument database queries, connection pools, and detect N+1 queries
How this skill is triggered — by the user, by Claude, or both
Slash command
/backend-observability:skills/database-observabilityThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Database is often the bottleneck. Track queries, pools, and patterns.
Database is often the bottleneck. Track queries, pools, and patterns.
| Attribute | Example | Required |
|---|---|---|
db.system | postgresql, mysql | Yes |
db.operation | SELECT, INSERT | Yes |
db.name | orders_db | Yes |
db.sql.table | users | Recommended |
db.statement | SELECT * FROM users WHERE id = ? | Parameterized only! |
| Metric | Type | Description |
|---|---|---|
db.connections.active | Gauge | In use |
db.connections.idle | Gauge | Available |
db.connections.max | Gauge | Pool limit |
db.connections.wait_count | Counter | Had to wait |
db.connections.wait_duration | Histogram | Wait time |
| Issue | Detection | Fix |
|---|---|---|
| N+1 queries | >10 identical queries per request | Use eager loading |
| Slow queries | Duration > p95 threshold | Add indexes, optimize |
| Pool exhaustion | wait_count increasing | Increase pool, fix leaks |
Before: Start span (db.system, db.operation, db.sql.table), start timer
After: Record duration, set db.rows_affected, record errors, end span
Every 10s: Record active, idle, wait_count, wait_duration from pool stats
references/methodology/use-methodology.mdreferences/platforms/{platform}/database.mdnpx claudepluginhub nexus-labs-automation/backend-observabilitySets up Grafana Cloud Database Observability for MySQL and PostgreSQL with query-level RED metrics, explain plans, and trace correlation. Use for diagnosing slow queries or connecting DB metrics to APM.
Monitors transactions in PostgreSQL, MySQL, MongoDB for long-running queries, lock contention, idle sessions, and throughput using CLI queries and scripts.
Inventories database schema, migrations, data volume, backups, connection pooling, and query patterns. Use for assessing database health, understanding schema, or 'database health check'.