agentsclimarketplace

Database observability

Skill nexus-labs-automation/backend-observability/skills/database-observability

Instrument database queries, connection pools, and detect N+1 queriesFrom its SKILL.md

Install
npx -y skills add nexus-labs-automation/backend-observability --skill database-observability

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.9 KB, as published. Nobody here has run it

Database Observability

Database is often the bottleneck. Track queries, pools, and patterns.

Query Span Attributes

AttributeExampleRequired
db.systempostgresql, mysqlYes
db.operationSELECT, INSERTYes
db.nameorders_dbYes
db.sql.tableusersRecommended
db.statementSELECT * FROM users WHERE id = ?Parameterized only!

Connection Pool Metrics (USE)

MetricTypeDescription
db.connections.activeGaugeIn use
db.connections.idleGaugeAvailable
db.connections.maxGaugePool limit
db.connections.wait_countCounterHad to wait
db.connections.wait_durationHistogramWait time

Issues to Detect

IssueDetectionFix
N+1 queries>10 identical queries per requestUse eager loading
Slow queriesDuration > p95 thresholdAdd indexes, optimize
Pool exhaustionwait_count increasingIncrease pool, fix leaks

Query Wrapper Pattern

Before: Start span (db.system, db.operation, db.sql.table), start timer
After:  Record duration, set db.rows_affected, record errors, end span

Pool Monitor Pattern

Every 10s: Record active, idle, wait_count, wait_duration from pool stats

Anti-Patterns

  • Full SQL with values → PII risk, use parameterized only
  • No pool metrics → Can't detect saturation
  • Missing slow query alerts → Problems go unnoticed

References

  • references/methodology/use-methodology.md
  • references/platforms/{platform}/database.md

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.