postgres_exporter extended metrics

13 views
Skip to first unread message

Elena Zarubina

unread,
Sep 22, 2020, 4:57:38 PM9/22/20
to Prometheus Users
Hi! I'm using postgres_exporter with extended metrics, but I see only default metrics in the output. What could be the problem?
 /opt/postgres_exporter/metrics.yaml:

table_stats:
  query: "select quote_ident(ut.relname) as tag_table_name, pg_total_relation_size(relid)/1024 as total_relation_size_b from pg_stat_user_tables ut join pg_class c on c.oid = ut.relid where not exists(select 1 from pg_locks where relation = relid and mode = 'AccessExclusiveLock' and granted)" and c.relpersistence != 't'"
  metrics:
    - tag_table_name:
        usage: "LABEL"
        description: "Name of this table"
    - total_relation_size_b:
        usage: "COUNTER"
        description: "Table size"

Start of postgres_exporter service:
/usr/local/bin/postgres_exporter --disable-default-metrics --disable-settings-metrics --extend.query-path=/opt/postgres_exporter/metrics.yaml
Output:
# curl -s http://localhost:9187/metrics | grep table
# HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table.
Reply all
Reply to author
Forward
0 new messages