Skip to content
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. Review standards and 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 evidence path

Database Reliability Monitoring Template: implementation to decision

Treat the prompt as an implementation brief. The useful artifact is not copied code alone, but a reviewed event contract that produces a trustworthy answer.

  1. 1

    Select the boundary

    Instrument the point where database_query_completed becomes final.

  2. 2

    Create the contract

    Start with database_query_completed, database_pool_sampled, database_transaction_completed and keep every field typed, bounded, and privacy-reviewed.

  3. 3

    Run a fixture

    Exercise known success, failure, retry, and empty-result cases before relying on aggregate results.

  4. 4

    Answer the question

    Which bounded database operation fingerprints are consistently slow?

Template versus use case

This page is the implementation brief

Copy this template when the measurement goal is already clear. Use the matching use-case guide to review event boundaries, success definitions, and the decisions the resulting SQL should support.

Read Database Reliability Monitoring with SQL

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.

Event schema starting points

Review the row grain, emit boundary, required types, privacy classes, example payload, and validation checklist before adapting a query or snippet to production.

Related product capability

Continue this workflow in SQL query API

Run read-only DataFusion SQL over structured-event tables and reuse the result.

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
Database reliabilityIntermediate

Detect N+1 Database Query Patterns

Which route and query combinations repeat suspiciously within a request?

Open recipe
Database reliabilityBeginner

Find Slow Database Queries by Fingerprint

Which database operations are consistently slow enough to investigate?

Open recipe
Database reliabilityBeginner

Measure Database Connection-Pool Saturation

Which application pools are making callers wait for a database connection?

Open recipe
Database reliabilityIntermediate

Calculate Database Transaction Rollback Rate

Which services roll back an unusual share of database transactions?

Open recipe
Database reliabilityIntermediate

Find Database Lock Waits and Deadlocks

Which database operations create the most serious lock contention?

Open recipe
Database reliabilityBeginner

Measure Database Replication and CDC Lag

Which replicas or CDC consumers are falling behind their source database?

Open recipe
Database reliabilityBeginner

Track Database Migration Failures by Release

Which releases contain failed or rolled-back database migrations?

Open recipe
Database reliabilityBeginner

Rank Database Queries by Total Time Impact

Which database operation consumes the most cumulative request time?

Open recipe
Database reliabilityIntermediate

Measure Long-Running Database Transactions

Which application transaction classes remain open the longest?

Open recipe
Database reliabilityBeginner

Analyze Database Errors by SQLSTATE and Release

Which database error classes increased after an application release?

Open recipe
Database reliabilityIntermediate

Measure Database Connection Timeouts and Churn

Which services and regions show unhealthy database connection churn?

Open recipe
Database reliabilityAdvanced

Measure Database Replica Staleness by Region

Which replica regions are serving stale or failed reads?

Open recipe
Complete collectionsDatabase reliability SQL

More templates