Skip to content

Commit 4caa7e2

Browse files
committed
adjust config format alignment for multiple collectors
- Align YAML metric definition indentation for consistency - Affected collectors: pg_doc, pg, pg_slot, pg_recv, pg_backend, pg_indexing, pg_clustering, pg_backup, pg_db, pg_index, pg_func, pgbouncer_database, pgbouncer_stat
1 parent 85dd1e2 commit 4caa7e2

13 files changed

+70
-70
lines changed

config/0000-doc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#==============================================================#
22
# Desc : pg_exporter metrics collector definition
3-
# Ver : PostgreSQL 10 ~ 18+ and pgbouncer 1.9~1.24+
3+
# Ver : PostgreSQL 10 ~ 18+ and pgbouncer 1.9~1.25+
44
# Ctime : 2019-12-09
5-
# Mtime : 2025-07-17
5+
# Mtime : 2025-12-15
66
# Homepage : https://pigsty.io
77
# Author : Ruohang Feng ([email protected])
88
# License : Apache-2.0 @ https://github.com/pgsty/pg_exporter

config/0110-pg.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ pg_replica_only:
7171
fatal: true
7272
skip: false
7373
metrics:
74-
- timestamp: { usage: GAUGE ,description: database current timestamp }
74+
- timestamp: { usage: GAUGE ,description: current database timestamp in unix epoch }
7575
- uptime: { usage: GAUGE ,description: seconds since postmaster start }
76-
- boot_time: { usage: GAUGE ,description: unix timestamp when postmaster boot }
76+
- boot_time: { usage: GAUGE ,description: postmaster boot timestamp in unix epoch }
7777
- lsn: { usage: COUNTER ,description: log sequence number, current write location }
7878
- insert_lsn: { usage: COUNTER ,description: primary only, location of current wal inserting }
7979
- write_lsn: { usage: COUNTER ,description: primary only, location of current wal writing }
@@ -85,6 +85,6 @@ pg_replica_only:
8585
- last_replay_time: { usage: GAUGE ,description: time when last transaction been replayed }
8686
- lag: { usage: GAUGE ,description: replica only, replication lag in seconds }
8787
- is_in_recovery: { usage: GAUGE ,description: 1 if in recovery mode }
88-
- is_wal_replay_paused: { usage: GAUGE ,description: 1 if wal play paused }
88+
- is_wal_replay_paused: { usage: GAUGE ,description: 1 if wal play is paused }
8989

9090

config/0240-pg_slot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#==============================================================#
44
pg_slot_17:
55
name: pg_slot
6-
desc: PostgreSQL replication slot metrics v17
6+
desc: PostgreSQL replication slot metrics v17, slot also exists on standby
77
query: |-
88
SELECT s.slot_name, s.slot_type, plugin, database AS datname,datoid,active_pid,
99
active,temporary,two_phase,conflicting,failover,synced,
@@ -52,7 +52,7 @@ pg_slot_17:
5252

5353
pg_slot_16:
5454
name: pg_slot
55-
desc: PostgreSQL replication slot metrics v16 with conflicting
55+
desc: PostgreSQL replication slot metrics v16 with conflicting, now slot also exists on standby
5656
query: |-
5757
SELECT s.slot_name, s.slot_type, plugin, database AS datname,datoid,active_pid,
5858
active,temporary,two_phase,conflicting,xmin::TEXT::BIGINT AS xmin,catalog_xmin::TEXT::BIGINT AS catalog_xmin,

config/0250-pg_recv.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pg_recv_10:
7676
7777
ttl: 10
7878
tags: [ cluster, replica ]
79-
min_version: 090600
79+
min_version: 100000
8080
max_version: 110000
8181
metrics:
8282
- sender_host: { usage: LABEL ,description: Host of the PostgreSQL instance this WAL receiver is connected to }

config/0430-pg_backend.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
#==============================================================#
44
pg_backend:
55
name: pg_backend
6-
desc: PostgreSQL backend client count group by wait event type since 9.6
6+
desc: PostgreSQL backend client count group by wait event type since 10
77
query: SELECT backend_type AS "type", count(*) AS count FROM pg_stat_activity GROUP BY backend_type;
88
ttl: 10
9-
min_version: 090600
9+
min_version: 100000
1010
tags: [ cluster ]
1111
metrics:
1212
- type: { usage: LABEL ,description: Database backend process type }

config/0520-pg_indexing.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ pg_indexing:
1111
(CASE WHEN partitions_total > 0 THEN 1.0 * partitions_done / partitions_total ELSE NULL END) AS partitions,
1212
(CASE WHEN lockers_total > 0 THEN 1.0 * lockers_done / lockers_total ELSE NULL END) AS lockers
1313
FROM pg_stat_progress_create_index pspci;
14-
14+
1515
ttl: 10
1616
min_version: 120000
1717
tags: [ cluster, primary ]
1818
metrics:
19-
- datname: { usage: LABEL, description: Name of the database }
20-
- pid: { usage: LABEL, description: Process id of indexing table }
21-
- relname: { usage: LABEL, description: Relation name of indexed table }
22-
- blocks: { usage: GAUGE, description: Percent of blocks been proceeded }
23-
- tuples: { usage: GAUGE, description: Percent of tuples been proceeded }
24-
- partitions: { usage: GAUGE, description: Percent of partitions been proceeded }
25-
- lockers: { usage: GAUGE, description: Percent of lockers been proceeded }
19+
- datname: { usage: LABEL ,description: Name of the database }
20+
- pid: { usage: LABEL ,description: Process id of indexing table }
21+
- relname: { usage: LABEL ,description: Relation name of indexed table }
22+
- blocks: { usage: GAUGE ,description: Percent of blocks been proceeded }
23+
- tuples: { usage: GAUGE ,description: Percent of tuples been proceeded }
24+
- partitions: { usage: GAUGE ,description: Percent of partitions been proceeded }
25+
- lockers: { usage: GAUGE ,description: Percent of lockers been proceeded }
2626

2727

config/0530-pg_clustering.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ pg_clustering:
99
min_version: 120000
1010
tags: [ cluster, primary ]
1111
metrics:
12-
- datname: { usage: LABEL, description: Name of databae been clustering }
13-
- pid: { usage: LABEL, description: Process id of indexing table }
14-
- relname: { usage: LABEL, description: Relation name of indexed table }
15-
- tup_scan: { usage: GAUGE, description: How much tuple been scanned }
16-
- progress: { usage: GAUGE, description: Progress of heap been processed }
12+
- datname: { usage: LABEL ,description: Name of database been clustering }
13+
- pid: { usage: LABEL ,description: Process id of indexing table }
14+
- relname: { usage: LABEL ,description: Relation name of indexed table }
15+
- tup_scan: { usage: GAUGE ,description: How much tuple been scanned }
16+
- progress: { usage: GAUGE ,description: Progress of heap been processed }
1717

1818

config/0540-pg_backup.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ pg_backup:
99
min_version: 130000
1010
tags: [ cluster ]
1111
metrics:
12-
- pid: { usage: LABEL, description: process id of basebackup sender }
13-
- phase: { usage: GAUGE, description: Phase encoded in 0~5 initial, wait checkpoint, estimate, streaming, waiting archive, transfer archive }
14-
- total_bytes: { usage: GAUGE, description: Total amount of data that will be streamed }
15-
- sent_bytes: { usage: GAUGE, description: Amount of data streamed }
12+
- pid: { usage: LABEL ,description: process id of basebackup sender }
13+
- phase: { usage: GAUGE ,description: Phase encoded in 0~5 initial, wait checkpoint, estimate, streaming, waiting archive, transfer archive }
14+
- total_bytes: { usage: GAUGE ,description: Total amount of data that will be streamed }
15+
- sent_bytes: { usage: GAUGE ,description: Amount of data streamed }
1616

1717

config/0610-pg_db.yml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ pg_db_18:
1616
min_version: 180000
1717
tags: [ cluster ]
1818
metrics:
19-
- datname: { usage: LABEL ,description: Name of the database }
20-
- datid: { usage: GAUGE ,description: OID of the database }
21-
- age: { usage: GAUGE ,description: Age of database calculated from datfrozenxid }
22-
- is_template: { usage: GAUGE ,description: If true(1), then this database can be cloned by any user with CREATEDB privileges }
23-
- allow_conn: { usage: GAUGE ,description: If false(0) then no one can connect to this database. }
24-
- conn_limit: { usage: GAUGE ,description: Sets maximum number of concurrent connections that can be made to this database. -1 means no limit. }
25-
- frozen_xid: { usage: GAUGE ,description: All transaction IDs before this one have been frozened }
26-
- numbackends: { usage: GAUGE ,description: Number of backends currently connected to this database }
19+
- datname: { usage: LABEL ,description: Name of the database }
20+
- datid: { usage: GAUGE ,description: OID of the database }
21+
- age: { usage: GAUGE ,description: Age of database calculated from datfrozenxid }
22+
- is_template: { usage: GAUGE ,description: If true(1), then this database can be cloned by any user with CREATEDB privileges }
23+
- allow_conn: { usage: GAUGE ,description: If false(0) then no one can connect to this database. }
24+
- conn_limit: { usage: GAUGE ,description: Sets maximum number of concurrent connections that can be made to this database. -1 means no limit. }
25+
- frozen_xid: { usage: GAUGE ,description: All transaction IDs before this one have been frozen }
26+
- numbackends: { usage: GAUGE ,description: Number of backends currently connected to this database }
2727
- xact_commit: { usage: COUNTER ,description: Number of transactions in this database that have been committed }
2828
- xact_rollback: { usage: COUNTER ,description: Number of transactions in this database that have been rolled back }
2929
- xact_total: { usage: COUNTER ,description: Number of transactions in this database }
@@ -41,7 +41,7 @@ pg_db_18:
4141
- temp_bytes: { usage: COUNTER ,description: Total amount of data written to temporary files by queries in this database. }
4242
- deadlocks: { usage: COUNTER ,description: Number of deadlocks detected in this database }
4343
- cks_fails: { usage: COUNTER ,description: Number of data page checksum failures detected in this database, -1 for not enabled }
44-
- cks_fail_time: { usage: GAUGE ,description: Time at which the last data page checksum failure was detected in this database }
44+
- cks_fail_time: { usage: GAUGE ,description: Time at which the last data page checksum failure was detected in this database }
4545
- blk_read_time: { usage: COUNTER ,scale: 1e-3 ,description: Time spent reading data file blocks by backends in this database, in seconds }
4646
- blk_write_time: { usage: COUNTER ,scale: 1e-3 ,description: Time spent writing data file blocks by backends in this database, in seconds }
4747
- session_time: { usage: COUNTER ,scale: 1e-3 ,description: Time spent by database sessions in this database, in seconds }
@@ -70,14 +70,14 @@ pg_db_14:
7070
max_version: 180000
7171
tags: [ cluster ]
7272
metrics:
73-
- datname: { usage: LABEL ,description: Name of the database }
74-
- datid: { usage: GAUGE ,description: OID of the database }
75-
- age: { usage: GAUGE ,description: Age of database calculated from datfrozenxid }
76-
- is_template: { usage: GAUGE ,description: If true(1), then this database can be cloned by any user with CREATEDB privileges }
77-
- allow_conn: { usage: GAUGE ,description: If false(0) then no one can connect to this database. }
78-
- conn_limit: { usage: GAUGE ,description: Sets maximum number of concurrent connections that can be made to this database. -1 means no limit. }
79-
- frozen_xid: { usage: GAUGE ,description: All transaction IDs before this one have been frozened }
80-
- numbackends: { usage: GAUGE ,description: Number of backends currently connected to this database }
73+
- datname: { usage: LABEL ,description: Name of the database }
74+
- datid: { usage: GAUGE ,description: OID of the database }
75+
- age: { usage: GAUGE ,description: Age of database calculated from datfrozenxid }
76+
- is_template: { usage: GAUGE ,description: If true(1), then this database can be cloned by any user with CREATEDB privileges }
77+
- allow_conn: { usage: GAUGE ,description: If false(0) then no one can connect to this database. }
78+
- conn_limit: { usage: GAUGE ,description: Sets maximum number of concurrent connections that can be made to this database. -1 means no limit. }
79+
- frozen_xid: { usage: GAUGE ,description: All transaction IDs before this one have been frozen }
80+
- numbackends: { usage: GAUGE ,description: Number of backends currently connected to this database }
8181
- xact_commit: { usage: COUNTER ,description: Number of transactions in this database that have been committed }
8282
- xact_rollback: { usage: COUNTER ,description: Number of transactions in this database that have been rolled back }
8383
- xact_total: { usage: COUNTER ,description: Number of transactions in this database }
@@ -95,7 +95,7 @@ pg_db_14:
9595
- temp_bytes: { usage: COUNTER ,description: Total amount of data written to temporary files by queries in this database. }
9696
- deadlocks: { usage: COUNTER ,description: Number of deadlocks detected in this database }
9797
- cks_fails: { usage: COUNTER ,description: Number of data page checksum failures detected in this database, -1 for not enabled }
98-
- cks_fail_time: { usage: GAUGE ,description: Time at which the last data page checksum failure was detected in this database }
98+
- cks_fail_time: { usage: GAUGE ,description: Time at which the last data page checksum failure was detected in this database }
9999
- blk_read_time: { usage: COUNTER ,scale: 1e-3 ,description: Time spent reading data file blocks by backends in this database, in seconds }
100100
- blk_write_time: { usage: COUNTER ,scale: 1e-3 ,description: Time spent writing data file blocks by backends in this database, in seconds }
101101
- session_time: { usage: COUNTER ,scale: 1e-3 ,description: Time spent by database sessions in this database, in seconds }
@@ -122,14 +122,14 @@ pg_db_12:
122122
max_version: 140000
123123
tags: [ cluster ]
124124
metrics:
125-
- datname: { usage: LABEL ,description: Name of the database }
126-
- datid: { usage: GAUGE ,description: OID of the database }
127-
- age: { usage: GAUGE ,description: Age of database calculated from datfrozenxid }
128-
- is_template: { usage: GAUGE ,description: If true(1), then this database can be cloned by any user with CREATEDB privileges }
129-
- allow_conn: { usage: GAUGE ,description: If false(0) then no one can connect to this database. }
130-
- conn_limit: { usage: GAUGE ,description: Sets maximum number of concurrent connections that can be made to this database. -1 means no limit. }
131-
- frozen_xid: { usage: GAUGE ,description: All transaction IDs before this one have been frozened }
132-
- numbackends: { usage: GAUGE ,description: Number of backends currently connected to this database }
125+
- datname: { usage: LABEL ,description: Name of the database }
126+
- datid: { usage: GAUGE ,description: OID of the database }
127+
- age: { usage: GAUGE ,description: Age of database calculated from datfrozenxid }
128+
- is_template: { usage: GAUGE ,description: If true(1), then this database can be cloned by any user with CREATEDB privileges }
129+
- allow_conn: { usage: GAUGE ,description: If false(0) then no one can connect to this database. }
130+
- conn_limit: { usage: GAUGE ,description: Sets maximum number of concurrent connections that can be made to this database. -1 means no limit. }
131+
- frozen_xid: { usage: GAUGE ,description: All transaction IDs before this one have been frozen }
132+
- numbackends: { usage: GAUGE ,description: Number of backends currently connected to this database }
133133
- xact_commit: { usage: COUNTER ,description: Number of transactions in this database that have been committed }
134134
- xact_rollback: { usage: COUNTER ,description: Number of transactions in this database that have been rolled back }
135135
- xact_total: { usage: COUNTER ,description: Number of transactions in this database }
@@ -147,7 +147,7 @@ pg_db_12:
147147
- temp_bytes: { usage: COUNTER ,description: Total amount of data written to temporary files by queries in this database. }
148148
- deadlocks: { usage: COUNTER ,description: Number of deadlocks detected in this database }
149149
- cks_fails: { usage: COUNTER ,description: Number of data page checksum failures detected in this database, -1 for not enabled }
150-
- cks_fail_time: { usage: GAUGE ,description: Time at which the last data page checksum failure was detected in this database }
150+
- cks_fail_time: { usage: GAUGE ,description: Time at which the last data page checksum failure was detected in this database }
151151
- blk_read_time: { usage: COUNTER ,scale: 1e-3 ,description: Time spent reading data file blocks by backends in this database, in seconds }
152152
- blk_write_time: { usage: COUNTER ,scale: 1e-3 ,description: Time spent writing data file blocks by backends in this database, in seconds }
153153
- reset_time: { usage: GAUGE ,description: Time at which database statistics were last reset }
@@ -164,14 +164,14 @@ pg_db_10:
164164
max_version: 120000
165165
tags: [ cluster ]
166166
metrics:
167-
- datname: { usage: LABEL ,description: Name of the database }
168-
- datid: { usage: GAUGE ,description: OID of the database }
169-
- age: { usage: GAUGE ,description: Age of database calculated from datfrozenxid }
170-
- is_template: { usage: GAUGE ,description: If true(1), then this database can be cloned by any user with CREATEDB privileges }
171-
- allow_conn: { usage: GAUGE ,description: If false(0) then no one can connect to this database. }
172-
- conn_limit: { usage: GAUGE ,description: Sets maximum number of concurrent connections that can be made to this database. -1 means no limit. }
173-
- frozen_xid: { usage: GAUGE ,description: All transaction IDs before this one have been frozened }
174-
- numbackends: { usage: GAUGE ,description: Number of backends currently connected to this database }
167+
- datname: { usage: LABEL ,description: Name of the database }
168+
- datid: { usage: GAUGE ,description: OID of the database }
169+
- age: { usage: GAUGE ,description: Age of database calculated from datfrozenxid }
170+
- is_template: { usage: GAUGE ,description: If true(1), then this database can be cloned by any user with CREATEDB privileges }
171+
- allow_conn: { usage: GAUGE ,description: If false(0) then no one can connect to this database. }
172+
- conn_limit: { usage: GAUGE ,description: Sets maximum number of concurrent connections that can be made to this database. -1 means no limit. }
173+
- frozen_xid: { usage: GAUGE ,description: All transaction IDs before this one have been frozen }
174+
- numbackends: { usage: GAUGE ,description: Number of backends currently connected to this database }
175175
- xact_commit: { usage: COUNTER ,description: Number of transactions in this database that have been committed }
176176
- xact_rollback: { usage: COUNTER ,description: Number of transactions in this database that have been rolled back }
177177
- xact_total: { usage: COUNTER ,description: Number of transactions in this database }

config/0710-pg_index.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ pg_index:
1717
min_version: 090400
1818
metrics:
1919
- datname: { usage: LABEL ,description: Database name of this index }
20-
- idxname: { usage: LABEL ,description: Name of this index (full-qualifed schema name) }
21-
- relname: { usage: LABEL ,description: Name of the table for this index (full-qualifed schema name) }
20+
- idxname: { usage: LABEL ,description: Name of this index (full-qualified schema name) }
21+
- relname: { usage: LABEL ,description: Name of the table for this index (full-qualified schema name) }
2222
- relid: { usage: LABEL ,description: Relation oid of this index }
2323
- relpages: { usage: GAUGE ,description: Size of the on-disk representation of this index in pages }
2424
- reltuples: { usage: GAUGE ,description: Estimate relation tuples }

0 commit comments

Comments
 (0)