-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy path0510-pg_vacuuming.yml
More file actions
69 lines (62 loc) · 3.84 KB
/
0510-pg_vacuuming.yml
File metadata and controls
69 lines (62 loc) · 3.84 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
#==============================================================#
# 0510 pg_vacuuming
#==============================================================#
pg_vacuuming_18:
name: pg_vacuuming
desc: PostgreSQL vacuum progress 18+
query: |-
SELECT datname, pid, relid::RegClass AS relname,
CASE phase WHEN 'scanning heap' THEN (CASE WHEN heap_blks_total > 0 THEN 1.0 * heap_blks_scanned / heap_blks_total ELSE 0.0 END)
WHEN 'vacuuming heap' THEN (CASE WHEN heap_blks_total > 0 THEN 1.0 * heap_blks_vacuumed / heap_blks_total ELSE 0 END) ELSE NULL END AS progress,
indexes_total, indexes_processed, dead_tuple_bytes, delay_time
FROM pg_stat_progress_vacuum;
ttl: 10
min_version: 180000
tags: [ cluster, primary ]
metrics:
- datname: { usage: LABEL ,description: "database name" }
- pid: { usage: LABEL ,description: "process id of vacuum worker" }
- relname: { usage: LABEL ,description: "relation name of vacuuming table" }
- progress: { usage: GAUGE ,description: "vacuum progress ratio (0-1) based on heap blocks scanned/vacuumed" }
- indexes_total: { usage: GAUGE ,description: "total number of indexes that will be vacuumed or cleaned up" }
- indexes_processed: { usage: GAUGE ,description: "number of indexes that have been vacuumed or cleaned up" }
- dead_tuple_bytes: { usage: GAUGE ,description: "total size of dead tuples collected since the beginning of vacuum in bytes" }
- delay_time: { usage: COUNTER ,scale: 1e-3 ,description: "total time spent sleeping due to cost-based delay in seconds" }
pg_vacuuming_17:
name: pg_vacuuming
desc: PostgreSQL vacuum progress 17 (with index progress tracking)
query: |-
SELECT datname, pid, relid::RegClass AS relname,
CASE phase WHEN 'scanning heap' THEN (CASE WHEN heap_blks_total > 0 THEN 1.0 * heap_blks_scanned / heap_blks_total ELSE 0.0 END)
WHEN 'vacuuming heap' THEN (CASE WHEN heap_blks_total > 0 THEN 1.0 * heap_blks_vacuumed / heap_blks_total ELSE 0 END) ELSE NULL END AS progress,
indexes_total, indexes_processed, dead_tuple_bytes
FROM pg_stat_progress_vacuum;
ttl: 10
min_version: 170000
max_version: 180000
tags: [ cluster, primary ]
metrics:
- datname: { usage: LABEL ,description: "database name" }
- pid: { usage: LABEL ,description: "process id of vacuum worker" }
- relname: { usage: LABEL ,description: "relation name of vacuuming table" }
- progress: { usage: GAUGE ,description: "vacuum progress ratio (0-1) based on heap blocks scanned/vacuumed" }
- indexes_total: { usage: GAUGE ,description: "total number of indexes that will be vacuumed or cleaned up" }
- indexes_processed: { usage: GAUGE ,description: "number of indexes that have been vacuumed or cleaned up" }
- dead_tuple_bytes: { usage: GAUGE ,description: "total size of dead tuples collected since the beginning of vacuum in bytes" }
pg_vacuuming_12:
name: pg_vacuuming
desc: PostgreSQL vacuum progress 12-16
query: |-
SELECT datname, pid, relid::RegClass AS relname,
CASE phase WHEN 'scanning heap' THEN (CASE WHEN heap_blks_total > 0 THEN 1.0 * heap_blks_scanned / heap_blks_total ELSE 0.0 END)
WHEN 'vacuuming heap' THEN (CASE WHEN heap_blks_total > 0 THEN 1.0 * heap_blks_vacuumed / heap_blks_total ELSE 0 END) ELSE NULL END AS progress
FROM pg_stat_progress_vacuum;
ttl: 10
min_version: 120000
max_version: 170000
tags: [ cluster, primary ]
metrics:
- datname: { usage: LABEL ,description: "database name" }
- pid: { usage: LABEL ,description: "process id of vacuum worker" }
- relname: { usage: LABEL ,description: "relation name of vacuuming table" }
- progress: { usage: GAUGE ,description: "vacuum progress ratio (0-1) based on heap blocks scanned/vacuumed" }