postgres_exporter v0.8.0缺失特定指标,求问使用者及对应版本
关于postgres_exporter缺失指定指标的问题
- 你提到的
pg_stat_user_tables_n_tup_hot_upd、pg_stat_user_tables_idx_scan、pg_stat_user_tables_seq_scan这些指标确实有大量使用者,主要用于PostgreSQL的性能调优场景——比如分析表的索引利用率、全表扫描频率,以及热更新占比,对定位数据库性能瓶颈很关键。 - 这些指标在postgres_exporter v0.9.0及后续版本中属于默认采集范围。v0.8.0版本的默认配置未包含这些指标,你有两个解决方向:
- 直接升级到v0.9.0+版本,开箱即可获取这些指标;
- 在v0.8.0中通过自定义查询配置来添加采集,示例配置如下:
pg_stat_user_tables_custom: query: "SELECT schemaname, relname, seq_scan, idx_scan, n_tup_hot_upd FROM pg_stat_user_tables" metrics: - schemaname: usage: "LABEL" description: "Schema name containing the target table" - relname: usage: "LABEL" description: "Name of the target table" - seq_scan: usage: "COUNTER" description: "Total sequential scans initiated on the table" metric_name: "pg_stat_user_tables_seq_scan" - idx_scan: usage: "COUNTER" description: "Total index scans initiated on the table" metric_name: "pg_stat_user_tables_idx_scan" - n_tup_hot_upd: usage: "COUNTER" description: "Total rows updated in-place (without row relocation)" metric_name: "pg_stat_user_tables_n_tup_hot_upd"
内容的提问来源于stack exchange,提问作者Eric
相关产品推荐
相关产品推荐

