-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy path250-pg_recv.yml
340 lines (332 loc) · 15 KB
/
250-pg_recv.yml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
##
# SYNOPSIS
# pg_recv.pg_recv_13_*
#
# DESCRIPTION
# PostgreSQL walreceiver metrics 13+ (add written and flush lsn)
#
# OPTIONS
# Tags [cluster, replica]
# TTL 10
# Priority 0
# Timeout 100ms
# Fatal false
# Version 130000 ~ higher
# Source 250-pg_recv.yml
#
# METRICS
# sender_host (LABEL)
# Host of the PostgreSQL instance this WAL receiver is connected to
# sender_port (LABEL)
# Port number of the PostgreSQL instance this WAL receiver is connected to.
# slot_name (LABEL)
# Replication slot name used by this WAL receiver
# pid (GAUGE)
# Process ID of the WAL receiver process
# state (LABEL)
# Encoded activity status of the WAL receiver process 0-4 for streaming|startup|catchup|backup|stopping
# init_lsn (COUNTER)
# First write-ahead log location used when WAL receiver is started
# init_tli (COUNTER)
# First timeline number used when WAL receiver is started
# flush_lsn (COUNTER)
# Last write-ahead log location already received and flushed to disk
# write_lsn (COUNTER)
# Last write-ahead log location already received and written to disk, but not flushed.
# flush_tli (COUNTER)
# Timeline number of last write-ahead log location received and flushed to disk
# reported_lsn (COUNTER)
# Last write-ahead log location reported to origin WAL sender
# msg_send_time (GAUGE)
# Send time of last message received from origin WAL sender
# msg_recv_time (GAUGE)
# Receipt time of last message received from origin WAL sender
# reported_time (GAUGE)
# Time of last write-ahead log location reported to origin WAL sender
# time (GAUGE)
# Time of current snapshot
#
pg_recv_13:
name: pg_recv
desc: PostgreSQL walreceiver metrics 13+ (add written and flush lsn)
query: |
SELECT coalesce(sender_host, (regexp_match(conninfo, '.*host=(\S+).*'))[1]) AS sender_host, coalesce(sender_port::TEXT, (regexp_match(conninfo, '.*port=(\S+).*'))[1]) AS sender_port, slot_name,
pid, CASE status WHEN 'streaming' THEN 0 WHEN 'startup' THEN 1 WHEN 'catchup' THEN 2 WHEN 'backup' THEN 3 WHEN 'stopping' THEN 4 ELSE -1 END AS state,
receive_start_lsn - '0/0' AS init_lsn,receive_start_tli AS init_tli,
flushed_lsn - '0/0' AS flush_lsn,written_lsn - '0/0'AS write_lsn, received_tli AS flush_tli, latest_end_lsn - '0/0' AS reported_lsn,
last_msg_send_time AS msg_send_time,last_msg_receipt_time AS msg_recv_time,latest_end_time AS reported_time,now() AS time FROM pg_stat_wal_receiver;
ttl: 10
min_version: 130000
tags:
- cluster
- replica
metrics:
- sender_host:
usage: LABEL
description: Host of the PostgreSQL instance this WAL receiver is connected to
# Host of the PostgreSQL instance this WAL receiver is connected to. This can be a host name, an IP address,
# or a directory path if the connection is via Unix socket.
# (The path case can be distinguished because it will always be an absolute path, beginning with /.)
- sender_port:
usage: LABEL
description: Port number of the PostgreSQL instance this WAL receiver is connected to.
- slot_name:
usage: LABEL
description: Replication slot name used by this WAL receiver
- pid:
usage: GAUGE
description: Process ID of the WAL receiver process
- state:
usage: LABEL
description: Encoded activity status of the WAL receiver process 0-4 for streaming|startup|catchup|backup|stopping
- init_lsn:
usage: COUNTER
description: First write-ahead log location used when WAL receiver is started
- init_tli:
usage: COUNTER
description: First timeline number used when WAL receiver is started
- flush_lsn:
usage: COUNTER
description: Last write-ahead log location already received and flushed to disk
# the initial value of this field being the first log location used when WAL receiver is started
- write_lsn:
usage: COUNTER
description: Last write-ahead log location already received and written to disk, but not flushed.
# Last write-ahead log location already received and written to disk, but not flushed. This should not be used for data integrity checks.
- flush_tli:
usage: COUNTER
description: Timeline number of last write-ahead log location received and flushed to disk
# Timeline number of last write-ahead log location received and flushed to disk, the initial value of this field being the timeline number of the first log location used when WAL receiver is started
- 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
- time:
usage: GAUGE
description: Time of current snapshot
##
# SYNOPSIS
# pg_recv.pg_recv_11_*
#
# DESCRIPTION
# PostgreSQL walreceiver metrics v11 v12 (add sender host and port)
#
# OPTIONS
# Tags [cluster, replica]
# TTL 10
# Priority 0
# Timeout 100ms
# Fatal false
# Version 110000 ~ 130000
# Source 250-pg_recv.yml
#
# METRICS
# sender_host (LABEL)
# Host of the PostgreSQL instance this WAL receiver is connected to
# sender_port (LABEL)
# Port number of the PostgreSQL instance this WAL receiver is connected to.
# slot_name (LABEL)
# Replication slot name used by this WAL receiver
# pid (GAUGE)
# Process ID of the WAL receiver process
# state (LABEL)
# Encoded activity status of the WAL receiver process 0-4 for streaming|startup|catchup|backup|stopping
# init_lsn (COUNTER)
# First write-ahead log location used when WAL receiver is started
# init_tli (COUNTER)
# First timeline number used when WAL receiver is started
# flush_lsn (COUNTER)
# Last write-ahead log location already received and flushed to disk
# flush_tli (COUNTER)
# Timeline number of last write-ahead log location received and flushed to disk
# reported_lsn (COUNTER)
# Last write-ahead log location reported to origin WAL sender
# msg_send_time (GAUGE)
# Send time of last message received from origin WAL sender
# msg_recv_time (GAUGE)
# Receipt time of last message received from origin WAL sender
# reported_time (GAUGE)
# Time of last write-ahead log location reported to origin WAL sender
# time (GAUGE)
# Time of current snapshot
#
pg_recv_11:
name: pg_recv
desc: PostgreSQL walreceiver metrics v11 v12 (add sender host and port)
query: |
SELECT coalesce(sender_host, (regexp_match(conninfo, '.*host=(\S+).*'))[1]) AS sender_host, coalesce(sender_port::TEXT, (regexp_match(conninfo, '.*port=(\S+).*'))[1]) AS sender_port, slot_name,
pid, CASE status WHEN 'streaming' THEN 0 WHEN 'startup' THEN 1 WHEN 'catchup' THEN 2 WHEN 'backup' THEN 3 WHEN 'stopping' THEN 4 ELSE -1 END AS state,
receive_start_lsn - '0/0' AS init_lsn,receive_start_tli AS init_tli,
received_lsn - '0/0' AS flush_lsn, received_tli AS flush_tli, latest_end_lsn - '0/0' AS reported_lsn,
last_msg_send_time AS msg_send_time,last_msg_receipt_time AS msg_recv_time,latest_end_time AS reported_time,now() AS time FROM pg_stat_wal_receiver;
ttl: 10
tags:
- cluster
- replica
min_version: 110000
max_version: 130000
metrics:
- sender_host:
usage: LABEL
description: Host of the PostgreSQL instance this WAL receiver is connected to
# Host of the PostgreSQL instance this WAL receiver is connected to. This can be a host name, an IP address,
# or a directory path if the connection is via Unix socket.
# (The path case can be distinguished because it will always be an absolute path, beginning with /.)
- sender_port:
usage: LABEL
description: Port number of the PostgreSQL instance this WAL receiver is connected to.
- slot_name:
usage: LABEL
description: Replication slot name used by this WAL receiver
- pid:
usage: GAUGE
description: Process ID of the WAL receiver process
- state:
usage: LABEL
description: Encoded activity status of the WAL receiver process 0-4 for streaming|startup|catchup|backup|stopping
- init_lsn:
usage: COUNTER
description: First write-ahead log location used when WAL receiver is started
- init_tli:
usage: COUNTER
description: First timeline number used when WAL receiver is started
- flush_lsn:
usage: COUNTER
description: Last write-ahead log location already received and flushed to disk
# the initial value of this field being the first log location used when WAL receiver is started
- flush_tli:
usage: COUNTER
description: Timeline number of last write-ahead log location received and flushed to disk
# Timeline number of last write-ahead log location received and flushed to disk, the initial value of this field being the timeline number of the first log location used when WAL receiver is started
- 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
- time:
usage: GAUGE
description: Time of current snapshot
##
# SYNOPSIS
# pg_recv.pg_recv_10_*
#
# DESCRIPTION
# PostgreSQL walreceiver metrics v10 (v9.6)
#
# OPTIONS
# Tags [cluster, replica]
# TTL 10
# Priority 0
# Timeout 100ms
# Fatal false
# Version 90600 ~ 110000
# Source 250-pg_recv.yml
#
# METRICS
# sender_host (LABEL)
# Host of the PostgreSQL instance this WAL receiver is connected to
# sender_port (LABEL)
# Port number of the PostgreSQL instance this WAL receiver is connected to.
# slot_name (LABEL)
# Replication slot name used by this WAL receiver
# pid (GAUGE)
# Process ID of the WAL receiver process
# state (LABEL)
# Encoded activity status of the WAL receiver process 0-4 for streaming|startup|catchup|backup|stopping
# init_lsn (COUNTER)
# First write-ahead log location used when WAL receiver is started
# init_tli (COUNTER)
# First timeline number used when WAL receiver is started
# flush_lsn (COUNTER)
# Last write-ahead log location already received and flushed to disk
# flush_tli (COUNTER)
# Timeline number of last write-ahead log location received and flushed to disk
# reported_lsn (COUNTER)
# Last write-ahead log location reported to origin WAL sender
# msg_send_time (GAUGE)
# Send time of last message received from origin WAL sender
# msg_recv_time (GAUGE)
# Receipt time of last message received from origin WAL sender
# reported_time (GAUGE)
# Time of last write-ahead log location reported to origin WAL sender
# time (GAUGE)
# Time of current snapshot
#
pg_recv_10:
name: pg_recv
desc: PostgreSQL walreceiver metrics v10 (v9.6)
query: |
SELECT (regexp_match(conninfo, '.*host=(\S+).*'))[1] AS sender_host, (regexp_match(conninfo, '.*port=(\S+).*'))[1] AS sender_port, slot_name,
pid, CASE status WHEN 'streaming' THEN 0 WHEN 'startup' THEN 1 WHEN 'catchup' THEN 2 WHEN 'backup' THEN 3 WHEN 'stopping' THEN 4 ELSE -1 END AS state,
receive_start_lsn - '0/0' AS init_lsn,receive_start_tli AS init_tli,
received_lsn - '0/0' AS flush_lsn, received_tli AS flush_tli, latest_end_lsn - '0/0' AS reported_lsn,
last_msg_send_time AS msg_send_time,last_msg_receipt_time AS msg_recv_time,latest_end_time AS reported_time,now() AS time FROM pg_stat_wal_receiver;
ttl: 10
tags:
- cluster
- replica
min_version: 090600
max_version: 110000
metrics:
- sender_host:
usage: LABEL
description: Host of the PostgreSQL instance this WAL receiver is connected to
# Host of the PostgreSQL instance this WAL receiver is connected to. This can be a host name, an IP address,
# or a directory path if the connection is via Unix socket.
# (The path case can be distinguished because it will always be an absolute path, beginning with /.)
- sender_port:
usage: LABEL
description: Port number of the PostgreSQL instance this WAL receiver is connected to.
- slot_name:
usage: LABEL
description: Replication slot name used by this WAL receiver
- pid:
usage: GAUGE
description: Process ID of the WAL receiver process
- state:
usage: LABEL
description: Encoded activity status of the WAL receiver process 0-4 for streaming|startup|catchup|backup|stopping
- init_lsn:
usage: COUNTER
description: First write-ahead log location used when WAL receiver is started
- init_tli:
usage: COUNTER
description: First timeline number used when WAL receiver is started
- flush_lsn:
usage: COUNTER
description: Last write-ahead log location already received and flushed to disk
# the initial value of this field being the first log location used when WAL receiver is started
- flush_tli:
usage: COUNTER
description: Timeline number of last write-ahead log location received and flushed to disk
# Timeline number of last write-ahead log location received and flushed to disk, the initial value of this field being the timeline number of the first log location used when WAL receiver is started
- 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
- time:
usage: GAUGE
description: Time of current snapshot