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:
# HELP go_memstats_buck_hash_sys_bytes Number of bytes used by the profiling bucket hash table.