指标分类 | 指标名称 | 指标含义 | 指标单位 | 本地盘实例 | 云盘版实例 |
连接 | db.connections.active | 活跃连接数 | Counts | ✔️ | ✔️ |
db.connections.waiting | 等待连接数 | Counts | ✔️ | ✔️ |
db.connections.idle | 空闲连接数 | Counts | ✔️ | ✔️ |
db.connections.total | 连接数 | Counts | ✔️ | ✔️ |
db.connections.spec | 规格连接数 | Counts | ✔️ | ✔️ |
SQL | db.sql.tup_returned | 每秒返回行数 | Tuples/s | ✔️ | ✔️ |
db.sql.tup_fetched | 每秒读取行数 | Tuples/s | ✔️ | ✔️ |
db.sql.tup_inserted | 每秒插入行数 | Tuples/s | ✔️ | ✔️ |
db.sql.tup_deleted | 每秒删除行数 | Tuples/s | ✔️ | ✔️ |
db.sql.tup_updated | 每秒更新行数 | Tuples/s | ✔️ | ✔️ |
慢SQL | db.slow_sql.one_second | 已执行1s的SQL数 | Counts | ✔️ | ✔️ |
db.slow_sql.three_seconds | 已执行3s的SQL数 | Counts | ✔️ | ✔️ |
db.slow_sql.five_seconds | 已执行5s的SQL数 | Counts | ✔️ | ✔️ |
长事务 | db.long_transactions.active_one_second | 已执行1s的事务数 | Counts | ✔️ | ✔️ |
db.long_transactions.active_three_seconds | 已执行3s的事务数 | Counts | ✔️ | ✔️ |
db.long_transactions.idle_one_second | 已空闲1s的事务数 | Counts | ✔️ | ✔️ |
db.long_transactions.idle_three_seconds | 已空闲3s的事务数 | Counts | ✔️ | ✔️ |
db.long_transactions.idle_five_seconds | 已空闲5s的事务数 | Counts | ✔️ | ✔️ |
db.long_transactions.two_pc_one_second | 已执行1s的两阶段事务 | Counts | ✔️ | ✔️ |
db.long_transactions.two_pc_three_seconds | 已执行3s的两阶段事务 | Counts | ✔️ | ✔️ |
db.long_transactions.two_pc_five_seconds | 已执行5s的两阶段事务 | Counts | ✔️ | ✔️ |
临时文件数 | db.temp.temp_files | 每秒临时文件生成个数 | Counts/s | ✔️ | ✔️ |
临时文件大小 | db.temp.temp_bytes | 每秒临时文件数据生成大小 | Bytes/s | ✔️ | ✔️ |
数据库最大年龄 | db.age.max_age. | 数据库最大年龄 | xids | ✔️ | ✔️ |
只读同步延迟 | db.ro_replica.replay_lag | 只读实例replay延迟时间 | s | ✔️ | ✔️ |
db.ro_replica.write_lag | 只读实例write延迟时间 | s | ✔️ | ✔️ |
db.ro_replica.flush_lag | 只读实例flush延迟时间 | s | ✔️ | ✔️ |
数据库内存分布 | db.mem_size.spec | 规格内存大小 | MB | ✔️ | ✔️ |
db.mem_size.shared_buffer | shared_buffer内存使用量 | MB | ✔️ | ✔️ |
db.mem_size.rss | rss内存使用量 说明 表示PostgreSQL进程的malloc内存,与连接数量、运行的SQL相关,与db.mem_size.cache 弹性共享75%内存,通常在10%左右。 | MB | ✔️ | ✔️ |
db.mem_size.free | 空闲内存 说明 完全空闲的内存,将会慢慢趋近于0,PostgreSQL会尽可能将空闲内存用于db.mem_size.cache,使实例内存利用率达到100%。 | MB | ✔️ | ✔️ |
db.mem_size.cache | page cache内存使用量 说明 第二级数据缓存,与db.mem_size.rss 弹性共享75%内存,通常在65%左右。 | MB | ✔️ | ✔️ |
数据库可用内存 | db.mem_available.size | 数据库可用内存 说明 可用内存=空闲内存+可快速回收的cache内存 ,当db.mem_size.rss 持续增加时,将会使用此部分内存以防止OOM。
| MB | ✔️ | ✔️ |
数据库可用内存率 | db.mem_available.ratio | 数据库可用内存率 | % | ✔️ | ✔️ |
SharedBuffers命中率 | db.buffers.hit_ratio | shared_buffers命中率 | % | ✔️ | ✔️ |
SharedBuffers命中次数 | db.buffers.blks_hit | shared_buffers每秒命中数 | Blocks/s | ✔️ | ✔️ |
IO | db.io.blks_read | backend进程每秒磁盘read次数(OS buffered read) | Counts/s | ✔️ | ✔️ |
db.io.buffers_backend | backend进程每秒磁盘write次数(OS buffered write) | Counts/s | ✔️ | ✔️ |
db.io.buffers_checkpoint | checkpoint进程每秒磁盘write次数(OS buffered write) | Counts/s | ✔️ | ✔️ |
db.io.buffers_clean | bgwriter进程每秒磁盘write次数(OS buffered write) | Counts/s | ✔️ | ✔️ |
db.io.buffers_backend_fsync | backend进程每秒执行磁盘fsync的次数 | Counts/s | ✔️ | ✔️ |
Checkpoint次数 | db.checkpoint.checkpoints_timed | 每秒内核调度的checkpoints数量 | Counts/s | ✔️ | ✔️ |
db.checkpoint.checkpoints_req | 每秒外部请求的checkpoints数量 | Counts/s | ✔️ | ✔️ |
事务TPS | db.transactions.xact_commit | 每秒写事务提交数 | Counts/s | ✔️ | ✔️ |
db.transactions.xact_rollback | 每秒写事务回滚数 | Counts/s | ✔️ | ✔️ |
事务状态 | db.transactions.active | 活跃状态事务数 | Counts | ✔️ | ✔️ |
db.transactions.waiting | 等待状态事务数 | Counts | ✔️ | ✔️ |
db.transactions.idle | idle-in-transaction状态事务数(注意:不合理状态,需要尽快处理) | Counts | ✔️ | ✔️ |
膨胀点 | db.swell.swell_time | 膨胀点,最长事务已执行时间 | s | ✔️ | ✔️ |
ReplicationSlot延迟 | db.slots.max_slot_wal_delay | 最大ReplicationSlot wal复制延迟(注意:复制位点之后的wal需要被保留,该值较大时会导致wal堆积,需要尽快处理) | MB | ✔️ | ✔️ |
Checkpoint写时间 | db.checkpoint.checkpoints_sync_time | checkpoint进程平均每秒磁盘fsync时间 | ms/s | ✔️ | ✔️ |
db.checkpoint.checkpoints_write_time | checkpoint进程平均每秒磁盘write时间(OS buffered write) | ms/s | ✔️ | ✔️ |
PgBouncer连接 | db.pgbouncer.client_connections.active | 客户端活跃连接数 说明 只有开启连接池功能后,才可以在增强监控中查看连接池的相关监控指标。 | Counts | ❌ | ✔️ |
db.pgbouncer.client_connections.waiting | 客户端等待连接数 | Counts | ❌ | ✔️ |
db.pgbouncer.server_connections.active | 服务端活跃连接数 | Counts | ❌ | ✔️ |
db.pgbouncer.server_connections.idle | 服务端空闲连接数 | Counts | ❌ | ✔️ |
db.pgbouncer.total_pooled_connections | 连接池总连接数 | Counts | ❌ | ✔️ |
db.pgbouncer.num_pools | 连接池数量 | Counts | ❌ | ✔️ |