Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aj-geddes avatar

Database Monitoring

  • 421 installs
  • 305 repo stars
  • Updated March 4, 2026
  • aj-geddes/useful-ai-prompts

database-monitoring is an agent skill that configures Postgres and MySQL observability with slow-query alerts, connection-pool metrics, replication checks, and capacity dashboards.

About

database-monitoring is an aj-geddes/useful-ai-prompts agent skill for comprehensive database performance and health monitoring on Postgres and MySQL workloads. It establishes performance baselines, real-time health checks, capacity planning queries, slow-query analysis, resource utilization tracking, alerting rule configuration, and incident troubleshooting playbooks. Quick-start SQL examples query pg_stat_activity for active connections, per-database connection counts, and idle transaction detection before pointing to seven detailed reference guides covering connection monitoring, query performance, table and index stats, MySQL Performance Schema, InnoDB monitoring, PostgreSQL monitoring setup, and automated dashboard creation. Developers reach for database-monitoring when standing up observability for production databases, analyzing slow queries, tracking replication lag, or building proactive alert rules instead of reacting to outages without metrics.

  • Slow-query detection
  • Connection pool metrics
  • Replication lag alerts
  • Capacity and disk planning

Database Monitoring by the numbers

  • 421 all-time installs (skills.sh)
  • Ranked #139 of 911 Databases skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill database-monitoring

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs421
repo stars305
Last updatedMarch 4, 2026
Repositoryaj-geddes/useful-ai-prompts

How do you monitor Postgres slow queries in production?

Configure database observability with slow-query alerts, connection-pool metrics, replication lag checks, and capacity dashboards for Postgres or MySQL.

Who is it for?

Backend and SRE developers operating Postgres or MySQL production databases who need metrics collection, alerting, and troubleshooting SQL patterns.

Skip if: Greenfield schema design or ORM modeling—database-monitoring focuses on runtime observability rather than initial database architecture.

When should I use this skill?

Production databases need slow-query alerts, connection-pool monitoring, replication lag checks, capacity dashboards, or incident troubleshooting SQL.

What you get

pg_stat_activity queries, connection monitoring scripts, performance baseline metrics, alerting rules, and reference guide implementations for dashboards.

  • Monitoring SQL queries
  • Alerting rule guidance
  • Dashboard setup patterns

By the numbers

  • Includes 7 reference guides in the references/ directory

Files

SKILL.mdMarkdownGitHub ↗

Database Monitoring

Table of Contents

Overview

Implement comprehensive database monitoring for performance analysis, health checks, and proactive alerting. Covers metrics collection, analysis, and troubleshooting strategies.

When to Use

  • Performance baseline establishment
  • Real-time health monitoring
  • Capacity planning
  • Query performance analysis
  • Resource utilization tracking
  • Alerting rule configuration
  • Incident response and troubleshooting

Quick Start

Minimal working example:

-- View current connections
SELECT
  pid,
  usename,
  application_name,
  client_addr,
  state,
  query_start,
  state_change
FROM pg_stat_activity
WHERE state != 'idle'
ORDER BY query_start DESC;

-- Count connections per database
SELECT
  datname,
  COUNT(*) as connection_count,
  MAX(EXTRACT(EPOCH FROM (NOW() - query_start))) as max_query_duration_sec
FROM pg_stat_activity
GROUP BY datname;

-- Find idle transactions
SELECT
  pid,
  usename,
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Connection MonitoringConnection Monitoring
Query Performance MonitoringQuery Performance Monitoring
Table & Index MonitoringTable & Index Monitoring
Performance SchemaPerformance Schema
InnoDB MonitoringInnoDB Monitoring
PostgreSQL Monitoring SetupPostgreSQL Monitoring Setup
Automated Monitoring DashboardAutomated Monitoring Dashboard

Best Practices

✅ DO

  • Follow established patterns and conventions
  • Write clean, maintainable code
  • Add appropriate documentation
  • Test thoroughly before deploying

❌ DON'T

  • Skip testing or validation
  • Ignore error handling
  • Hard-code configuration values

Related skills

FAQ

Which databases does database-monitoring support?

database-monitoring covers PostgreSQL and MySQL observability, with pg_stat_activity quick starts for Postgres connections and reference guides for Performance Schema, InnoDB stats, and PostgreSQL monitoring setup.

What metrics does database-monitoring help track?

database-monitoring guides slow-query alerts, connection-pool utilization, replication lag checks, table and index health, resource utilization, and capacity planning baselines for production database operations.

Where are full SQL implementations?

database-monitoring delegates detailed queries to seven references/ guides covering connection monitoring, query performance, table and index monitoring, Performance Schema, InnoDB, PostgreSQL setup, and automated dashboards.

Databasesmonitoringinfra

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.