Telemetry
Copy-paste instrumentation template

Database Reliability Monitoring Template

Instrument slow operation fingerprints, pool contention, transaction rollbacks, locks, replication lag, and migration outcomes with safe structured events.

Reviewed by the Telemetry product team on . Event names, recommended fields, analysis questions, and privacy boundaries. Editorial ownership

Questions this unlocks
  • Which bounded database operation fingerprints are consistently slow?
  • Which application pools make callers wait or time out?
  • Which releases correlate with rollbacks, deadlocks, lag, or failed migrations?

Template

Paste this into your coding agent

Replace YOUR_API_KEY, run the flow locally, then verify the generated events and dashboards.

database-reliability

Database Reliability Monitoring Template

text
Instrument application-level database reliability with Telemetry.

Use /skill.md and this Telemetry API key: YOUR_API_KEY

Log database_query_completed, database_pool_sampled, database_transaction_completed, database_lock_wait_completed, database_replication_sampled, and database_migration_completed with controlled fields such as:
query_fingerprint, service, database_name, pool_name, status, duration_ms, acquisition_wait_ms, active_connections, idle_connections, max_connections, transaction_id, error_type, lag_seconds, migration_id, release, and environment.

Create dashboards and reviewed alerts for slow-query rate by fingerprint, connection-pool waits and timeouts, transaction rollback rate, unresolved locks and deadlocks, replica or CDC lag, and migration failures by release.

Use bounded operation names and allowlisted error categories. Do not log raw SQL, query parameters, connection strings, credentials, database error messages, or customer records.

Events to capture

database_query_completeddatabase_pool_sampleddatabase_transaction_completeddatabase_lock_wait_completeddatabase_replication_sampleddatabase_migration_completed

Verification checklist

What a complete instrumentation pass leaves behind

Events

Synthetic events reach the intended table with stable names and field types.

Queries

The first SQL queries return plausible rows with an explicit time window.

Views

A dashboard uses the real fields and includes enough context to explain a change.

Safety

Prompts, bodies, credentials, signatures, and private content were checked for redaction.

Related SQL recipes

Answer the next question with SQL

Run the query against the structured fields from this workflow, inspect the example result, and turn a useful answer into a dashboard or alert.

Browse all recipes

More templates