-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy path520-pg_indexing.yml
72 lines (68 loc) · 2.03 KB
/
520-pg_indexing.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
##
# SYNOPSIS
# pg_indexing_*
#
# DESCRIPTION
# PostgreSQL index creating progress (v12+)
#
# OPTIONS
# Tags [cluster]
# TTL 10
# Priority 0
# Timeout 100ms
# Fatal false
# Version 120000 ~ higher
# Source 520-pg_indexing.yml
#
# METRICS
# datname (LABEL)
# Name of the database
# pid (LABEL)
# Process id of indexing table
# relname (LABEL)
# Relation name of indexed table
# blocks (GAUGE)
# Percent of blocks been proceeded
# tuples (GAUGE)
# Percent of tuples been proceeded
# partitions (GAUGE)
# Percent of partitions been proceeded
# lockers (GAUGE)
# Percent of lockers been proceeded
#
pg_indexing:
name: pg_indexing
desc: PostgreSQL index creating progress (v12+)
query: |
SELECT datname, pid, relid::RegClass AS relname,
(CASE WHEN blocks_total > 0 THEN 1.0 * blocks_done / blocks_total ELSE NULL END) AS blocks,
(CASE WHEN tuples_total > 0 THEN 1.0 * tuples_done / tuples_total ELSE NULL END) AS tuples,
(CASE WHEN partitions_total > 0 THEN 1.0 * partitions_done / partitions_total ELSE NULL END) AS partitions,
(CASE WHEN lockers_total > 0 THEN 1.0 * lockers_done / lockers_total ELSE NULL END) AS lockers
FROM pg_stat_progress_create_index pspci;
ttl: 10
min_version: 120000
tags:
- cluster
metrics:
- datname:
usage: LABEL
description: Name of the database
- pid:
usage: LABEL
description: Process id of indexing table
- relname:
usage: LABEL
description: Relation name of indexed table
- blocks:
usage: GAUGE
description: Percent of blocks been proceeded
- tuples:
usage: GAUGE
description: Percent of tuples been proceeded
- partitions:
usage: GAUGE
description: Percent of partitions been proceeded
- lockers:
usage: GAUGE
description: Percent of lockers been proceeded