PostgreSQL 檢查
postgresql 模組有 6 項檢查。透過具備 pg_monitor 的唯讀監控角色檢查 PostgreSQL(Flexible Server 或自行託管)。
本頁面在建置文件時由產品的檢查目錄產生,因此規則、間隔及預設嚴重程度一律與你正在閱讀的版本相符。閾值是預設值;實體和資源可以覆蓋這些閾值。
| 檢查 | 間隔 | 預設嚴重性 | 規則 |
|---|---|---|---|
postgresql.connectionsConnections used vs max | 60s | warning | warning > 80 percent / critical > 90 percent |
postgresql.replication_lagReplication lag | 60s | warning | warning > 60 seconds / critical > 300 seconds |
postgresql.vacuum_wraparoundTransaction ID age (wraparound risk) | 3600s | warning | warning > 1000000000 count / critical > 1500000000 count |
postgresql.bloat_estimateTable bloat (estimated, top tables) | 86400s | info | warning > 20 percent / critical > 40 percent |
postgresql.slow_queriesSlowest statements (pg_stat_statements) | 300s | info | ±2σ over 14d (learning only) |
postgresql.security_postureSecurity posture (superusers, SSL, pg_hba) | 3600s | warning | ssl = on, risky_hba_rules = 0 |
檢查
postgresql.connections
Connections used vs max
- 量度
used_percent(percent) · 每60s·pgsql- 規則
warning > 80 percent / critical > 90 percent· 預設嚴重性: warning- 措施
- —
- 基準
- Azure recommended rule for Flexible Server: connections > 80% of max.
postgresql.replication_lag
Replication lag
- 量度
lag_seconds(seconds) · 每60s·pgsql- 規則
warning > 60 seconds / critical > 300 seconds· 預設嚴重性: warning- 措施
- —
postgresql.vacuum_wraparound
Transaction ID age (wraparound risk)
- 量度
xid_age(count) · 每3600s·pgsql- 規則
warning > 1000000000 count / critical > 1500000000 count· 預設嚴重性: warning- 措施
- —
- 基準
- Forced vacuum at ~2.1 billion; warn at 1 billion. · 來源
postgresql.bloat_estimate
Table bloat (estimated, top tables)
- 量度
dead_percent(percent) · 每86400s·pgsql- 規則
warning > 20 percent / critical > 40 percent· 預設嚴重性: info- 措施
- —
postgresql.slow_queries
Slowest statements (pg_stat_statements)
- 量度
mean_ms(milliseconds) · 每300s·pgsql- 規則
±2σ over 14d (learning only)· 預設嚴重性: info- 措施
- —
- 基準
- Requires the pg_stat_statements extension.
postgresql.security_posture
Security posture (superusers, SSL, pg_hba)
- 量度
security_posture· 每3600s·pgsql- 規則
ssl = on, risky_hba_rules = 0· 預設嚴重性: warning- 措施
- —
- 基準
- superusers > 2 raises a warning; pg_hba_file_rules needs PostgreSQL 10+ and superuser or pg_read_server_files. · 來源
相關內容
- PostgreSQL:先決條件,以及如何新增資源
- 閾值與基線:如何覆蓋預設閾值