-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy path0260-pg_sub.yml
More file actions
98 lines (91 loc) · 5.28 KB
/
0260-pg_sub.yml
File metadata and controls
98 lines (91 loc) · 5.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#==============================================================#
# 0260 pg_sub
#==============================================================#
pg_sub_16:
name: pg_sub
desc: PostgreSQL subscription statistics (16+)
query: |-
SELECT
s1.subname, subid AS id, pid, received_lsn, reported_lsn,
msg_send_time, msg_recv_time, reported_time,
apply_error_count, sync_error_count
FROM
(SELECT
subname, subid, pid,
received_lsn - '0/0' AS received_lsn, latest_end_lsn - '0/0' AS reported_lsn,
extract(epoch from last_msg_send_time) AS msg_send_time,
extract(epoch from last_msg_receipt_time) AS msg_recv_time,
extract(epoch from latest_end_time) AS reported_time
FROM pg_stat_subscription
WHERE relid IS NULL AND leader_pid IS NULL) s1
LEFT OUTER JOIN pg_stat_subscription_stats s2 USING(subid);
ttl: 10
min_version: 160000
tags: [ cluster ]
metrics:
- subname: { usage: LABEL ,description: Name of this subscription }
- id: { usage: GAUGE ,description: OID of the subscription }
- pid: { usage: GAUGE ,description: Process ID of the subscription leader apply worker }
- received_lsn: { usage: COUNTER ,description: Last write-ahead log location received }
- reported_lsn: { usage: COUNTER ,description: Last write-ahead log location reported to origin WAL sender }
- msg_send_time: { usage: GAUGE ,description: Send time of last message received from origin WAL sender }
- msg_recv_time: { usage: GAUGE ,description: Receipt time of last message received from origin WAL sender }
- reported_time: { usage: GAUGE ,description: Time of last write-ahead log location reported to origin WAL sender }
- apply_error_count: { usage: COUNTER ,description: Number of times an error occurred while applying changes }
- sync_error_count: { usage: COUNTER ,description: Number of times an error occurred during the initial table synchronization }
pg_sub_15:
name: pg_sub
desc: PostgreSQL subscription statistics (15)
query: |-
SELECT
s1.subname, subid AS id, pid, received_lsn, reported_lsn,
msg_send_time, msg_recv_time, reported_time,
apply_error_count, sync_error_count
FROM
(SELECT
subname, subid, pid,
received_lsn - '0/0' AS received_lsn, latest_end_lsn - '0/0' AS reported_lsn,
extract(epoch from last_msg_send_time) AS msg_send_time,
extract(epoch from last_msg_receipt_time) AS msg_recv_time,
extract(epoch from latest_end_time) AS reported_time
FROM pg_stat_subscription WHERE relid ISNULL) s1
LEFT OUTER JOIN pg_stat_subscription_stats s2 USING(subid);
ttl: 10
min_version: 150000
max_version: 160000
tags: [ cluster ]
metrics:
- subname: { usage: LABEL ,description: Name of this subscription }
- id: { usage: GAUGE ,description: OID of the subscription }
- pid: { usage: GAUGE ,description: Process ID of the subscription main apply worker process }
- received_lsn: { usage: COUNTER ,description: Last write-ahead log location received }
- reported_lsn: { usage: COUNTER ,description: Last write-ahead log location reported to origin WAL sender }
- msg_send_time: { usage: GAUGE ,description: Send time of last message received from origin WAL sender }
- msg_recv_time: { usage: GAUGE ,description: Receipt time of last message received from origin WAL sender }
- reported_time: { usage: GAUGE ,description: Time of last write-ahead log location reported to origin WAL sender }
- apply_error_count: { usage: COUNTER ,description: Number of times an error occurred while applying changes. }
- sync_error_count: { usage: COUNTER ,description: Number of times an error occurred during the initial table synchronization }
pg_sub_10:
name: pg_sub
desc: PostgreSQL subscription statistics (10-14)
query: |-
SELECT
subname, subid AS id, pid,
received_lsn - '0/0' AS received_lsn, latest_end_lsn - '0/0' AS reported_lsn,
extract(epoch from last_msg_send_time) AS msg_send_time,
extract(epoch from last_msg_receipt_time) AS msg_recv_time,
extract(epoch from latest_end_time) AS reported_time
FROM pg_stat_subscription WHERE relid ISNULL;
ttl: 10
min_version: 100000
max_version: 150000
tags: [ cluster ]
metrics:
- subname: { usage: LABEL ,description: Name of this subscription }
- id: { usage: GAUGE ,description: OID of the subscription }
- pid: { usage: GAUGE ,description: Process ID of the subscription main apply worker process }
- received_lsn: { usage: COUNTER ,description: Last write-ahead log location received }
- reported_lsn: { usage: COUNTER ,description: Last write-ahead log location reported to origin WAL sender }
- msg_send_time: { usage: GAUGE ,description: Send time of last message received from origin WAL sender }
- msg_recv_time: { usage: GAUGE ,description: Receipt time of last message received from origin WAL sender }
- reported_time: { usage: GAUGE ,description: Time of last write-ahead log location reported to origin WAL sender }