Skip to content

Commit 0506b50

Browse files
committed
fix(monitor): correct metric types in polar_exporter.yml
- pg_origin: fix metric name roiname->roname, usage LABEL->COUNTER - pg_xact: fix SQL bug txid_snapshot_xmin->txid_snapshot_xmax for xmax - pg_archiver: fix metric names and time usage COUNTER->GAUGE - pg_recovery_prefetch: fix skip_fpw GAUGE->COUNTER, reset_time COUNTER->GAUGE - pg_slru/pg_wal/pg_db: fix reset_time usage COUNTER->GAUGE
1 parent bbdc1c9 commit 0506b50

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

files/polar_exporter.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#┃ Desc : pg_exporter metrics for restricted polardb ins ┃#
77
#┃ Ver : PostgreSQL 10~17 pgbouncer 1.8-1.23+ ┃#
88
#┃ Ctime : 2023-09-10 ┃#
9-
#┃ Mtime : 2025-02-14 ┃#
10-
#┃ License : Apache-2.0 @ https://pigsty.io/docs/about/license/ ┃#
9+
#┃ Mtime : 2025-01-07 ┃#
10+
#┃ License: Apache-2.0 @ https://pigsty.io/docs/about/license/┃#
1111
#┃ Copyright : 2018-2026 Ruohang Feng / Vonng (rh@vonng.com) ┃#
1212
#┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛#
1313
#################################################################
@@ -1371,14 +1371,14 @@ pg_origin:
13711371
- cluster
13721372

13731373
metrics:
1374-
- roiname:
1374+
- roname:
13751375
usage: LABEL
13761376
description: The external, user defined, name of a replication origin.
13771377
- remote_lsn:
1378-
usage: LABEL
1378+
usage: COUNTER
13791379
description: The origin node's LSN up to which data has been replicated.
13801380
- local_lsn:
1381-
usage: LABEL
1381+
usage: COUNTER
13821382
description: This node's LSN at which remote_lsn has been replicated.
13831383
# This node's LSN at which remote_lsn has been replicated. Used to flush commit records before persisting data to disk when using asynchronous commits.
13841384

@@ -1443,7 +1443,7 @@ pg_size:
14431443
pg_archiver:
14441444
name: pg_archiver
14451445
desc: PostgreSQL archiver process statistics
1446-
query: SELECT archived_count AS finish_count, failed_count, extract(EPOCH FROM last_archived_time) AS last_finish_time, extract(EPOCH FROM last_failed_time) AS last_failed_time, extract(EPOCH FROM stats_reset) AS reset_time FROM pg_stat_archiver;
1446+
query: SELECT archived_count AS finish_count, failed_count, extract(EPOCH FROM last_archived_time) AS finish_time, extract(EPOCH FROM last_failed_time) AS failed_time, extract(EPOCH FROM stats_reset) AS reset_time FROM pg_stat_archiver;
14471447
ttl: 60
14481448
min_version: 090400
14491449
tags:
@@ -1456,11 +1456,11 @@ pg_archiver:
14561456
- failed_count:
14571457
usage: COUNTER
14581458
description: Number of failed attempts for archiving WAL files
1459-
- last_finish_time:
1460-
usage: COUNTER
1459+
- finish_time:
1460+
usage: GAUGE
14611461
description: Time of the last successful archive operation
1462-
- last_failed_time:
1463-
usage: COUNTER
1462+
- failed_time:
1463+
usage: GAUGE
14641464
description: Time of the last failed archival operation
14651465
- reset_time:
14661466
usage: GAUGE
@@ -1811,7 +1811,7 @@ pg_recovery_prefetch:
18111811
usage: COUNTER
18121812
description: Number of blocks not prefetched because they didn't exist yet
18131813
- skip_fpw:
1814-
usage: GAUGE
1814+
usage: COUNTER
18151815
description: Number of blocks not prefetched because a full page image was included in the WAL
18161816
- skip_rep:
18171817
usage: COUNTER
@@ -1826,7 +1826,7 @@ pg_recovery_prefetch:
18261826
usage: GAUGE
18271827
description: How many prefetches have been initiated but are not yet known to have completed
18281828
- reset_time:
1829-
usage: COUNTER
1829+
usage: GAUGE
18301830
description: Time at which these recovery prefetch statistics were last reset
18311831

18321832

@@ -1867,7 +1867,7 @@ pg_slru_13:
18671867
usage: COUNTER
18681868
description: Number of truncates for this SLRU
18691869
- reset_time:
1870-
usage: COUNTER
1870+
usage: GAUGE
18711871
description: Time at which these statistics were last reset
18721872

18731873

@@ -1937,7 +1937,7 @@ pg_wal_14:
19371937
scale: 1e-3
19381938
description: Total amount of time spent syncing WAL files to disk via issue_xlog_fsync request, in seconds
19391939
- reset_time:
1940-
usage: COUNTER
1940+
usage: GAUGE
19411941
description: When statistics were last reset
19421942

19431943

@@ -2021,7 +2021,7 @@ pg_backend:
20212021
pg_xact:
20222022
name: pg_xact
20232023
desc: PostgreSQL transaction identifier metrics
2024-
query: WITH snap(v) AS (SELECT txid_current_snapshot()), xset(v) AS (SELECT txid_snapshot_xip(v) FROM snap), xnum(v) AS (SELECT count(*) from xset), xmin(v) AS (SELECT txid_snapshot_xmin(v) FROM snap), xmax(v) AS (SELECT txid_snapshot_xmin(v) FROM snap) SELECT xmin.v AS xmin, xmax.v AS xmax, xnum.v AS xnum FROM xmin, xmax, xnum;
2024+
query: WITH snap(v) AS (SELECT txid_current_snapshot()), xset(v) AS (SELECT txid_snapshot_xip(v) FROM snap), xnum(v) AS (SELECT count(*) from xset), xmin(v) AS (SELECT txid_snapshot_xmin(v) FROM snap), xmax(v) AS (SELECT txid_snapshot_xmax(v) FROM snap) SELECT xmin.v AS xmin, xmax.v AS xmax, xnum.v AS xnum FROM xmin, xmax, xnum;
20252025

20262026
ttl: 10
20272027
min_version: 090400
@@ -2513,7 +2513,7 @@ pg_db_14:
25132513
usage: COUNTER
25142514
description: Number of database sessions to this database that were terminated by operator intervention
25152515
- reset_time:
2516-
usage: COUNTER
2516+
usage: GAUGE
25172517
description: Time at which database statistics were last reset
25182518

25192519

@@ -2633,7 +2633,7 @@ pg_db_12_13:
26332633
description: Time spent writing data file blocks by backends in this database, in seconds
26342634
# Time spent writing data file blocks by backends in this database, in milliseconds (if track_io_timing is enabled, otherwise zero)
26352635
- reset_time:
2636-
usage: COUNTER
2636+
usage: GAUGE
26372637
description: Time at which database statistics were last reset
26382638

26392639

@@ -2744,7 +2744,7 @@ pg_db_10_11:
27442744
description: Time spent writing data file blocks by backends in this database, in seconds
27452745
# Time spent writing data file blocks by backends in this database, in milliseconds (if track_io_timing is enabled, otherwise zero)
27462746
- reset_time:
2747-
usage: COUNTER
2747+
usage: GAUGE
27482748
description: Time at which database statistics were last reset
27492749

27502750

0 commit comments

Comments
 (0)