Skip to content

Add table sizes #1037

Open
mowirth wants to merge 3 commits into
prometheus-community:masterfrom
mowirth:master
Open

Add table sizes #1037
mowirth wants to merge 3 commits into
prometheus-community:masterfrom
mowirth:master

Conversation

@mowirth
Copy link
Copy Markdown

@mowirth mowirth commented May 27, 2024

This MR adds total_relation_size, relation_size, indexes_size for all tables in all schemas.

Implements #1036

mowirth added 3 commits May 28, 2024 00:17
Signed-off-by: Moritz Wirth <mw@flanga.io>
Signed-off-by: Moritz Wirth <mw@flanga.io>
Signed-off-by: Moritz Wirth <mw@flanga.io>
@kostya-skw
Copy link
Copy Markdown

I'm waiting for it

@bilkoua
Copy link
Copy Markdown

bilkoua commented Mar 26, 2025

@sysadmind Would it be possible to add this functionality?

@azdfzshffg
Copy link
Copy Markdown

Up !
Would it be possible to add this functionality?

@azdfzshffg
Copy link
Copy Markdown

@sysadmind @spantaleev it be possible to add this functionality?

@bilkoua
Copy link
Copy Markdown

bilkoua commented Dec 5, 2025

[inputs.sql]
driver = "postgres"
dsn = "host=/run/postgresql user=myuser dbname=mydb"
[[inputs.sql.query]]
query = "SELECT current_database() AS db, schemaname, relname, pg_total_relation_size(relid) AS total_size_bytes FROM pg_statio_user_tables"
tag_columns_include = ["db", "schemaname", "relname"]

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

Successfully merging this pull request may close these issues.

4 participants