Created
March 6, 2020 16:21
-
-
Save adivinho/f7ec4ac34b5fe0cb07fa0c2b008a46e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Custom query | |
| pg_class: | |
| query: "SELECT datname, COALESCE(sbtest.relname) as relname, COALESCE(sbtest.rows) as rows, COALESCE(sbtest.total) as total, COALESCE(sbtest.index) as index, COALESCE(sbtest.toast,0) as toast FROM pg_database LEFT OUTER JOIN dblink('dbname=sbtest','SELECT current_database(), relname, CAST(reltuples as BIGINT), pg_total_relation_size(oid), pg_indexes_size(oid), pg_total_relation_size(reltoastrelid) FROM pg_class') as sbtest(datname name, relname name, rows BIGINT, total BIGINT, index BIGINT, toast BIGINT) USING (datname) WHERE datname NOT LIKE 'template_' AND datname NOT LIKE 'postgres'" | |
| metrics: | |
| - datname: | |
| usage: "LABEL" | |
| description: "Name of the database that this table is in" | |
| - relname: | |
| usage: "LABEL" | |
| description: "Name of the table, index, view, etc." | |
| - rows: | |
| usage: "GAUGE" | |
| decription: "Number of rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX" | |
| - total: | |
| usage: "GAUGE" | |
| description: "Total disk space used by the specified table, including all indexes and TOAST data" | |
| - index: | |
| usage: "GAUGE" | |
| description: "Total disk space used by indexes attached to the specified table" | |
| - toast: | |
| usage: "GAUGE" | |
| description: "Total disk space used by TOAST data attached to the specified table" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment