Skip to content

Commit 863011e

Browse files
authored
[postgres-exporter] Remove pg_database query
After the merge of prometheus-community/postgres_exporter#613, `postgres-exporter` installed by recent versions of the prometheus-postgres-exporter Helm chart is throwing 500 errors like: ``` HTTP/1.1 500 Internal Server Error Content-Type: text/plain; charset=utf-8 X-Content-Type-Options: nosniff Date: Tue, 29 Nov 2022 11:08:41 GMT Content-Length: 1418 An error has occurred while serving metrics: 4 error(s) occurred: * collected metric "pg_database_size_bytes" { label:<name:"datname" value:"template0" > label:<name:"server" value:"10.188.0.2:5432" > gauge:<value:8.225283e+06 > } was collected before with the same name and label values * collected metric "pg_database_size_bytes" { label:<name:"datname" value:"postgres" > label:<name:"server" value:"10.188.0.2:5432" > gauge:<value:8.373103e+06 > } was collected before with the same name and label values * collected metric "pg_database_size_bytes" { label:<name:"datname" value:"template1" > label:<name:"server" value:"10.188.0.2:5432" > gauge:<value:8.373103e+06 > } was collected before with the same name and label values * collected metric "pg_database_size_bytes" { label:<name:"datname" value:"default" > label:<name:"server" value:"10.188.0.2:5432" > gauge:<value:8.373103e+06 > } was collected before with the same name and label values ``` So we're removing the YAML query to avoid such conflict. Signed-off-by: Ahmad Sherif <[email protected]>
1 parent c3ed9d8 commit 863011e

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

charts/prometheus-postgres-exporter/values.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -315,18 +315,6 @@ config:
315315
usage: "COUNTER"
316316
description: "Number of buffer hits in this table's TOAST table indexes (if any)"
317317
318-
pg_database:
319-
query: "SELECT pg_database.datname, pg_database_size(pg_database.datname) as size_bytes FROM pg_database"
320-
master: true
321-
cache_seconds: 30
322-
metrics:
323-
- datname:
324-
usage: "LABEL"
325-
description: "Name of the database"
326-
- size_bytes:
327-
usage: "GAUGE"
328-
description: "Disk space used by the database"
329-
330318
pg_stat_statements:
331319
query: "SELECT t2.rolname, t3.datname, queryid, calls, ( total_plan_time + total_exec_time ) / 1000 as total_time_seconds, ( min_plan_time + min_exec_time ) / 1000 as min_time_seconds, ( max_plan_time + max_exec_time ) / 1000 as max_time_seconds, ( mean_plan_time + mean_exec_time ) / 1000 as mean_time_seconds, ( stddev_plan_time + stddev_exec_time ) / 1000 as stddev_time_seconds, rows, shared_blks_hit, shared_blks_read, shared_blks_dirtied, shared_blks_written, local_blks_hit, local_blks_read, local_blks_dirtied, local_blks_written, temp_blks_read, temp_blks_written, blk_read_time / 1000 as blk_read_time_seconds, blk_write_time / 1000 as blk_write_time_seconds FROM pg_stat_statements t1 JOIN pg_roles t2 ON (t1.userid=t2.oid) JOIN pg_database t3 ON (t1.dbid=t3.oid) WHERE t2.rolname != 'rdsadmin' AND queryid IS NOT NULL"
332320
master: true

0 commit comments

Comments
 (0)