You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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版本的默认配置未包含这些指标,你有两个解决方向:
    1. 直接升级到v0.9.0+版本,开箱即可获取这些指标;
    2. 在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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.18 21:05:21