-
Notifications
You must be signed in to change notification settings - Fork 45
/
510-pg_vacuuming.yml
54 lines (51 loc) · 1.39 KB
/
510-pg_vacuuming.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
##
# SYNOPSIS
# pg_vacuuming_*
#
# DESCRIPTION
# PostgreSQL vacuum progress since 9.6
#
# OPTIONS
# Tags [cluster]
# TTL 10
# Priority 0
# Timeout 100ms
# Fatal false
# Version 120000 ~ higher
# Source 510-pg_vacuuming.yml
#
# METRICS
# datname (LABEL)
# database name
# pid (LABEL)
# process id of indexing table
# relname (LABEL)
# relation name of indexed table
# progress (GAUGE)
# the actual progress
#
pg_vacuuming:
name: pg_vacuuming
desc: PostgreSQL vacuum progress since 9.6
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 pspv;
ttl: 10
min_version: 120000
tags:
- cluster
metrics:
- datname:
usage: LABEL
description: database name
- pid:
usage: LABEL
description: process id of indexing table
- relname:
usage: LABEL
description: relation name of indexed table
- progress:
usage: GAUGE
description: the actual progress