火山引擎 PostgreSQL
火山引擎 PostgreSQL 指标展示,包括 CPU 使用率、TPS、 死锁等。
配置¶
安装 Func¶
推荐开通 观测云集成 - 扩展 - 托管版 Func: 一切前置条件都自动安装好, 请继续脚本安装
如果自行部署 Func 参考自行部署 Func
安装脚本¶
提示:请提前准备好符合要求的火山引擎 AK(简单起见,可直接授予全局只读权限
ReadOnlyAccess)
同步 PostgreSQL 云资源的监控数据,我们安装对应的采集脚本:「观测云集成(火山引擎-PostgreSQL采集)」(ID:integration_volcengine_postgresql)
点击【安装】后,输入相应的参数:火山引擎 AK、火山引擎账户名。
点击【部署启动脚本】,系统会自动创建 Startup 脚本集,并自动配置相应的启动脚本。
开启后可以在「管理 / 自动触发配置」里看到对应的自动触发配置。点击【执行】,即可立即执行一次,无需等待定期时间。稍等片刻,可以查看执行任务记录以及对应日志。
如果要采集对应的日志,还要开启相应的日志采集脚本。如果要采集账单,要开启云账单采集脚本。
验证¶
- 在「管理 / 自动触发配置」确认对应的任务是否已存在对应的自动触发配置,同时可以查看对应任务记录及日志检查是否有异常
- 在观测云,「基础设施 / 自定义」中查看是否存在资产信息
- 在观测云,「指标」查看是否有对应监控数据
指标¶
- 指标集
volcengine_vcm_rds_postgresql
| 指标名 | 指标描述 | 单位 |
|---|---|---|
replication_delay |
主从复制延迟 | second |
db_conflicts |
每秒事务冲突数 | count/second |
replication_flush_lag |
主从 flush_lag | second |
replication_write_lag |
主从 write_lag | second |
unarchived_wal_segments_count |
待归档的 wal 文件个数 | count |
active_connection |
活跃连接数 | count |
idle_connection |
空闲连接数 | count |
idle_in_txn_connection |
不活跃事务数 | count |
rows_inserted |
每秒插入行数 | count/second |
rows_updated |
每秒更新行数 | count/second |
rows_deleted |
每秒删除行数 | count/second |
slow_queries |
每秒慢查询数 | count/second |
slow_queries_increment |
每30秒慢查询数量 | count |
total_connection |
总连接数 | count |
connection_used_util |
连接数使用率 | percent |
tps |
每秒事务数 | count/second |
commits_per_second |
每秒事务提交数 | count/second |
rollbacks_per_second |
每秒事务回滚数 | count/second |
longest_transaction_exec_time |
最长事务执行时间 | second |
db_max_age_xids |
数据库最大年龄 xids | none |
locks_ungranted_count |
锁等待数 | count |
read_only_status |
全局只读状态 | none |
shared_buffers_blks_hit |
每秒缓存命中数 | count/second |
shared_buffers_blks_hit_rate |
缓存命中率 | percent |
locks_granted_count |
锁持有数 | count |
error_queries |
每秒错误查询数 | count/second |
error_queries_increment |
每30秒错误查询增量 | count |
instantaneous_slow_queries |
瞬时慢查询数 | count |
dead_locks_count |
数据库死锁数 | count |
prepared_xacts_count |
2pc事务数 | count |
locks_ungranted_count_over_1h |
锁等待超1h查询数 | count |
db_fetched_returned_ratio |
数据返回与扫描比 | percent |
qps |
每秒查询数 | count/second |
slow_queries_custom_increment |
近n秒慢查询数量 | count |
oldest_prepared_xacts_duration |
2pc事务最长持续时间 | second |
rows_fetched |
每秒回表数 | count/second |
rows_returned |
每秒表扫描行数 | count/second |
transaction_success_rate |
事务成功率 | percent |
proxy_connection |
代理连接数 | count |
proxy_qps |
代理 qps | count/second |
proxy_cpu_util |
代理 cpu 使用率 | percent |
proxy_mem_util |
代理节点内存使用率 | percent |
cpu_util |
cpu 使用率 | percent |
mem_util |
内存使用率 | percent |
disk_util |
磁盘使用率 | percent |
user_cpu_util |
用户态 cpu 使用率 | percent |
sys_cpu_util |
系统态 cpu 使用率 | percent |
cache_mem_usage |
缓存内存使用量 | bytes(si) |
rss_mem_usage |
rss 内存使用量 | bytes(si) |
disk_usage |
磁盘使用量 | bytes(si) |
log_disk_usage |
运行日志磁盘使用量 | bytes(si) |
wal_disk_usage |
wal 日志磁盘使用量 | bytes(si) |
base_disk_usage |
数据文件磁盘使用量 | bytes(si) |
temp_file_disk_usage |
临时文件磁盘使用量 | bytes(si) |
network_receive_throughput |
网络输入流量 | bytes/second(si) |
network_transmit_throughput |
网络输出流量 | bytes/second(si) |
db_size |
数据库大小 | bytes(si) |
db_expansion_rate |
数据库膨胀率 | bytes/second(si) |
slot_max_wal_accumulation |
复制槽最大 wal 堆积量 | bytes(si) |
inactive_slot_count |
非活跃状态复制槽个数 | count |
slot_max_wal_accumulation_disk_ratio |
复制槽最大 wal 堆积量磁盘占比 | percent |
db_max_table_size |
数据库最大表大小 | bits(iec) |
对象¶
采集到的火山引擎 PostgreSQL 对象数据结构, 可以从「基础设施-自定义」里看到对象数据
{
"fields": {
"address_object": "xxxxxxxx",
"charge_detail": "xxxxxxxx",
"create_time": "2025-11-06T07:34:07.000Z",
"dbengine_version": "PostgreSQL_14",
"instance_status": "Running",
"message": "xxxxxxxx",
"node_spec": "rds.postgres.1c2g",
"storage_space": "20",
"storage_type": "LocalSSD",
"subnet_id": "subnet-3i6glfgpn5fr45r0lrqxxxxxxxx",
"vpc_id": "vpc-3qdy52316jny87prmlxxxxxxxx"
},
"measurement": "volcengine_postgresql",
"tags": {
"account_name": "pdsa-dev",
"cloud_provider": "volcengine",
"instance_id": "postgres-588f06xxxxxxxx",
"instance_name": "fyb-dev",
"instance_type": "HA",
"name": "postgres-588f06xxxxxxxx5",
"project_name": "default",
"region_id": "cn-shanghai",
"zone_id": "cn-shanghai-a"
}
}
]