skills/database-monitoring/SKILL.md
Monitor database performance and health. Use when setting up monitoring, analyzing metrics, or troubleshooting database issues.
npx skillsauth add aj-geddes/useful-ai-prompts database-monitoringInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Implement comprehensive database monitoring for performance analysis, health checks, and proactive alerting. Covers metrics collection, analysis, and troubleshooting strategies.
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)
Detailed implementations in the references/ directory:
| Guide | Contents | |---|---| | Connection Monitoring | Connection Monitoring | | Query Performance Monitoring | Query Performance Monitoring | | Table & Index Monitoring | Table & Index Monitoring | | Performance Schema | Performance Schema | | InnoDB Monitoring | InnoDB Monitoring | | PostgreSQL Monitoring Setup | PostgreSQL Monitoring Setup | | Automated Monitoring Dashboard | Automated Monitoring Dashboard |
development
Implement Zero Trust security model with identity verification, microsegmentation, least privilege access, and continuous monitoring. Use when building secure cloud-native applications.
development
Prevent Cross-Site Scripting (XSS) attacks through input sanitization, output encoding, and Content Security Policy. Use when handling user-generated content in web applications.
tools
Create wireframes and interactive prototypes to visualize user interfaces and gather feedback early. Use tools and techniques to communicate design ideas before development.
development
Implement real-time bidirectional communication with WebSockets including connection management, message routing, and scaling. Use when building real-time features, chat systems, live notifications, or collaborative applications.