-
Notifications
You must be signed in to change notification settings - Fork 45
/
360-pg_recovery.yml
105 lines (99 loc) · 3.2 KB
/
360-pg_recovery.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
##
# SYNOPSIS
# pg_recovery_*
#
# DESCRIPTION
# PostgreSQL control recovery metrics (9.6+)
#
# OPTIONS
# Tags [cluster, replica]
# TTL 10
# Priority 0
# Timeout 100ms
# Fatal false
# Version 90600 ~ higher
# Source 360-pg_recovery.yml
#
# METRICS
# min_timeline (COUNTER)
# Min recovery ending loc's timeline
# min_lsn (COUNTER)
# Minimum recovery ending location
# backup_start_lsn (COUNTER)
# Backup start location
# backup_end_lsn (COUNTER)
# Backup end location
# require_record (GAUGE)
# End-of-backup record required
#
pg_recovery:
name: pg_recovery
desc: PostgreSQL control recovery metrics (9.6+)
query: |
SELECT min_recovery_end_timeline AS min_timeline,
min_recovery_end_lsn - '0/0' AS min_lsn,
backup_start_lsn - '0/0' AS backup_start_lsn,
backup_end_lsn - '0/0' AS backup_end_lsn,
end_of_backup_record_required AS require_record
FROM pg_control_recovery();
ttl: 10
min_version: 090600
tags:
- cluster
- replica
metrics:
- min_timeline:
usage: COUNTER
description: Min recovery ending loc's timeline
- min_lsn:
usage: COUNTER
description: Minimum recovery ending location
- backup_start_lsn:
usage: COUNTER
description: Backup start location
- backup_end_lsn:
usage: COUNTER
description: Backup end location
- require_record:
usage: GAUGE
description: End-of-backup record required
pg_recovery_prefetch:
name: pg_recovery_prefetch
desc: PostgreSQL recovery prefetch metrics (15+)
query: SELECT prefetch,hit,skip_init,skip_new,skip_fpw,skip_rep,wal_distance,block_distance,io_depth,extract(EPOCH FROM stats_reset) AS reset_time FROM pg_stat_recovery_prefetch;
ttl: 10
min_version: 150000
tags:
- cluster
- replica
metrics:
- prefetch:
usage: COUNTER
description: Number of blocks prefetched because they were not in the buffer pool
- hit:
usage: COUNTER
description: Number of blocks not prefetched because they were already in the buffer pool
- skip_init:
usage: COUNTER
description: Number of blocks not prefetched because they would be zero-initialized
- skip_new:
usage: COUNTER
description: Number of blocks not prefetched because they didn't exist yet
- skip_fpw:
usage: GAUGE
description: Number of blocks not prefetched because a full page image was included in the WAL
- skip_rep:
usage: COUNTER
description: Number of blocks not prefetched because they were already recently prefetched
- wal_distance:
usage: GAUGE
description: How many bytes ahead the prefetcher is looking
- block_distance:
usage: GAUGE
description: How many blocks ahead the prefetcher is looking
- io_depth:
usage: GAUGE
description: How many prefetches have been initiated but are not yet known to have completed
- reset_time:
usage: COUNTER
description: Time at which these recovery prefetch statistics were last reset