Skip to content

pg_stat_user_table doesn't exist in pg-exporter #483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
micemuni opened this issue Feb 24, 2021 · 4 comments
Open

pg_stat_user_table doesn't exist in pg-exporter #483

micemuni opened this issue Feb 24, 2021 · 4 comments

Comments

@micemuni
Copy link

Hi Team,
We are using postgres 13 version, grafana - grafana/grafana:6.7.2 & the Prometheus - prom/prometheus:v2.17.0, pg-exporter - wrouesnel/postgres_exporter:v0.8.0. It's running in a docker platform.

Recently I tried to deploy the https://promcat.io/apps/postgresql dashboard

  • Database Golden Signals
  • Instance Health
    seems like the 2 panels ( Heap Only Tuple Updates Rate & Index vs Sequential Scans ) are not showing data in panels, when i checked with Prometheus, i can able to verify the Prometheus connected with the pg-exporter and the pg-exported metrics file have pg_stat_user_tables in nested query in pg_stat_statements_blk_read_time like below

pg_stat_statements_blk_read_time{datname="postgres",query="SELECT current_database() datname, schemaname, relname, seq_scan, seq_tup_read, idx_scan, idx_tup_fetch, n_tup_ins, n_tup_upd, n_tup_del, n_tup_hot_upd, n_live_tup, n_dead_tup, n_mod_since_analyze, COALESCE(last_vacuum, $1), COALESCE(last_vacuum, $2) as last_vacuum, COALESCE(last_autovacuum, $3) as last_autovacuum, COALESCE(last_analyze, $4) as last_analyze, COALESCE(last_autoanalyze, $5) as last_autoanalyze,
vacuum_count, autovacuum_count, analyze_count, autoanalyze_count FROM pg_stat_user_tables",queryid="-1171651946716037767",server="pgs:5432",user="postgres_exporter"} 0

Not sure why the grafana panels are not showing date for those 2 panels.

Any thoughts..? OR any mis-configured here..?

@micemuni
Copy link
Author

micemuni commented Feb 24, 2021

FYI attached snip
image

image

image

@tintinrevient
Copy link

Export PG_EXPORTER_EXTEND_QUERY_PATH=/path/to/queries.xml

queries.xml is at the root folder of the repo: https://github.com/prometheus-community/postgres_exporter/blob/master/queries.yaml

@SLoeuillet
Copy link

pg_stat_user_tables is a trap, its content depends on the DB to which you connect
if you connect to postgres or any system db, it would be empty

@DaveK-KNIME
Copy link

What is the current way to get pg_stat_user_tables metrics for all DBs on the server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants