Agent skill · data analytics · jeremylongshore
monitoring-database-health
Monitor use when you need to work with monitoring and observability.
Why this skill is useful
Provides specific SQL queries and alert thresholds for monitoring database health that the AI wouldn't reliably generate on its own.
What it needs
Requires mongosh, mysql, psql installed locally. About 4k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
Database Health Monitor Overview Monitor database server health across PostgreSQL, MySQL, and MongoDB by tracking key performance indicators including connection utilization, query throughput, replication lag, disk usage, cache hit ratios, vacuum activity, and lock contention. Prerequisites Database credentials with access to system statistics views (pgstat, performanceschema, serverStatus) psql, mysql, or mongosh CLI tools for running health check queries Permissions: pgmonitor role (PostgreSQL), PROCESS privilege (MySQL) Baseline metrics from a period of normal operation for threshold calibration Alerting channel configured (email, Slack webhook, PagerDuty) Instructions 1. Check connection utilization: PostgreSQL: SELECT count() AS activeconnections, (SELECT setting::int FROM pgsettings WHERE name = 'maxconnections') AS maxconnections, round(count()::numeric / (SELECT setting::int FROM pgsettings WHERE name = 'maxconnections') 100, 1) AS utilizationpct FROM pgstatactivity MySQL: SELECT VARIABLEVALUE AS connections FROM performanceschema.globalstatus WHERE VARIABLENAME = 'Threadsconnected' Alert threshold: utilization above 80% 2. Monitor query throughput and error rate: PostgreSQL: SELECT datname, xactcommit AS commitstotal, xactrollback AS rollbackstotal, xactrollback::float / GREATEST(xactcommit, 1) AS rollbackratio FROM pgstatdatabase WHERE datname = currentdatabase() MySQL: SHOW GLOBAL STATUS LIKE 'Comcommit' and SHOW GLOBAL STATUS LIKE 'Comrollback' Alert threshold: rollback ratio above 5% or throughput drops more than 50% from baseline 3. Check disk usage and growth: PostgreSQL: SELECT pgsizepretty(pgdatabasesize(currentdatabase())) AS dbsize and SELECT tablename, pgsizepretty(pgtotalrelationsize(tablename::text)) AS size FROM pgtables WHERE schemaname = 'public' ORDER BY pgtotalrelationsize(tablename::text) DESC LIMIT 10 Alert threshold: disk usage above 80% or growth rate projecting full disk within 7 days 4. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/monitoring-database-health--b1ff6c