Skip to content

Commit 808ebdf

Browse files
committed
fix: pg_stat_progress_vacuum metric is missing schema and table names
1 parent da20d27 commit 808ebdf

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

stackgres-k8s/src/operator/src/main/resources/prometheus-postgres-exporter/queries-1.22.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -855,14 +855,29 @@ pg_stat_current_waiting_query:
855855
pg_stat_progress_vacuum:
856856
query: |
857857
SELECT
858-
datname, heap_blks_total, heap_blks_scanned,
859-
heap_blks_vacuumed , index_vacuum_count , max_dead_tuples , num_dead_tuples
860-
FROM pg_stat_progress_vacuum;
858+
datname,
859+
nspname AS schemaname,
860+
relname,
861+
heap_blks_total,
862+
heap_blks_scanned,
863+
heap_blks_vacuumed,
864+
index_vacuum_count,
865+
max_dead_tuples,
866+
num_dead_tuples
867+
FROM pg_stat_progress_vacuum
868+
JOIN pg_class ON (pg_stat_progress_vacuum.relid = pg_class.oid)
869+
JOIN pg_namespace ON (pg_class.relnamespace = pg_namespace.oid);
861870
master: true
862871
metrics:
863872
- datname:
864873
usage: "LABEL"
865874
description: "Name of the database to which this backend is connected"
875+
- schemaname:
876+
usage: "LABEL"
877+
description: "Name of the schema that this table is in"
878+
- relname:
879+
usage: "LABEL"
880+
description: "Name of this table"
866881
- heap_blks_total:
867882
usage: "GAUGE"
868883
description: "Total number of heap blocks in the table"

stackgres-k8s/src/operator/src/main/resources/prometheus-postgres-exporter/queries.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -855,14 +855,29 @@ pg_stat_current_waiting_query:
855855
pg_stat_progress_vacuum:
856856
query: |
857857
SELECT
858-
datname, heap_blks_total, heap_blks_scanned,
859-
heap_blks_vacuumed , index_vacuum_count , max_dead_tuples , num_dead_tuples
860-
FROM pg_stat_progress_vacuum;
858+
datname,
859+
nspname AS schemaname,
860+
relname,
861+
heap_blks_total,
862+
heap_blks_scanned,
863+
heap_blks_vacuumed,
864+
index_vacuum_count,
865+
max_dead_tuples,
866+
num_dead_tuples
867+
FROM pg_stat_progress_vacuum
868+
JOIN pg_class ON (pg_stat_progress_vacuum.relid = pg_class.oid)
869+
JOIN pg_namespace ON (pg_class.relnamespace = pg_namespace.oid);
861870
master: true
862871
metrics:
863872
- datname:
864873
usage: "LABEL"
865874
description: "Name of the database to which this backend is connected"
875+
- schemaname:
876+
usage: "LABEL"
877+
description: "Name of the schema that this table is in"
878+
- relname:
879+
usage: "LABEL"
880+
description: "Name of this table"
866881
- heap_blks_total:
867882
usage: "GAUGE"
868883
description: "Total number of heap blocks in the table"

0 commit comments

Comments
 (0)