-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy path0360-pg_recovery.yml
More file actions
43 lines (40 loc) · 2.6 KB
/
0360-pg_recovery.yml
File metadata and controls
43 lines (40 loc) · 2.6 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
#==============================================================#
# 0360 pg_recovery
#==============================================================#
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: COUNTER ,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: GAUGE ,description: "Time at which these recovery prefetch statistics were last reset" }