mcpField
D
database-monitoring

database-monitoring

github.com/aj-geddesData & databases373463 installsUpdated 34w ago
Repository

About database-monitoring

A skill for implementing database monitoring to analyze performance, check health, and configure alerts. It provides guidance for metrics, query and resource monitoring, capacity planning, and troubleshooting.

Key features

  1. 01Performance metrics collection
  2. 02Database health checks
  3. 03Query performance analysis
  4. 04Resource utilization tracking
  5. 05Alert rule configuration
  6. 06Monitoring setup guides

Use cases

  1. 01Establishing a performance baseline
  2. 02Tracking database health in real time
  3. 03Planning database capacity
  4. 04Investigating query performance issues

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill database-monitoring

After installing, type/database-monitoringin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
automated-monitoring-dashboard.md
connection-monitoring.md
innodb-monitoring.md
performance-schema.md
postgresql-monitoring-setup.md
query-performance-monitoring.md
table-index-monitoring.md
scripts/
validate-schema.sh
templates/
migration-template.sql

Details

From the project README

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

Comments

Markdown supported