用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/pluginagentmarketplace/custom-plugin-postgresql --skill postgresql-monitoring命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | postgresql-monitoring |
| description | PostgreSQL monitoring - metrics, alerting, observability |
| version | 3.0.0 |
| sasmp_version | 1.3.0 |
| bonded_agent | 03-postgresql-performance |
| bond_type | SECONDARY_BOND |
| category | database |
| difficulty | intermediate |
| estimated_time | 3h |
Atomic skill for performance monitoring
Production-ready patterns for metrics collection, alerting, and observability.
parameters:
operation:
type: string
required: true
enum: [collect_metrics, setup_alerting, diagnose]
metric_type:
type: string
enum: [connections, queries, replication, storage]
-- Connection stats
SELECT count(*), state FROM pg_stat_activity GROUP BY state;
-- Slow queries
SELECT query, mean_exec_time FROM pg_stat_statements
ORDER BY mean_exec_time DESC LIMIT 10;
-- Cache hit ratio
SELECT round(100.0 * sum(heap_blks_hit) /
nullif(sum(heap_blks_hit + heap_blks_read), 0), 2) ratio
pg_statio_user_tables;
tablename, pg_size_pretty(pg_total_relation_size(tablename::regclass))
pg_tables schemaname pg_total_relation_size(tablename::regclass) ;
client_addr, pg_size_pretty(pg_wal_lsn_diff(sent_lsn, replay_lsn)) lag
pg_stat_replication;
| Metric | Warning | Critical |
|---|---|---|
| Connections | 80% max | 95% max |
| Cache hit | < 99% | < 95% |
| Replication lag | > 1MB | > 100MB |
| Dead tuples | > 10K | > 100K |
postgres-exporter:
image: prometheuscommunity/postgres-exporter
environment:
DATA_SOURCE_NAME: "postgresql://monitor:pass@postgres:5432/postgres"
| Problem | Cause | Solution |
|---|---|---|
| No stats | Extension missing | CREATE EXTENSION pg_stat_statements |
| Old metrics | Stats not reset | pg_stat_statements_reset() |
| High connections | Leak or surge | Check application |
Skill("postgresql-monitoring")
基于 SOC 职业分类