-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add disk usage metrics #83
Conversation
hey, @isaacseymour thank you so much for this! I'm going to double-check it and get it to release today. |
WHERE nspname NOT IN ('pg_catalog', 'information_schema') | ||
ORDER BY pg_relation_size(C.oid) DESC /*postgres_exporter*/` | ||
|
||
tableUsageQuery = ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@isaacseymour as we discuss this would rewrite this way:
SELECT schemaname
, relname
, pg_table_size(relid)::float
FROM pg_stat_user_tables /*postgres_exporter*/`
This will give us only the table size, including the toast tables and other things, but without the indices size. To get the whole size we can do an aggregation on Prometheus via a recording rule
Signed-off-by: Raúl Naveiras <[email protected]>
No description provided.