-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy path330-pg_bgwriter.yml
115 lines (109 loc) · 4.52 KB
/
330-pg_bgwriter.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
105
106
107
108
109
110
111
112
113
114
##
# SYNOPSIS
# pg_bgwriter_*
#
# DESCRIPTION
# PostgreSQL background writer metrics
#
# OPTIONS
# Tags [cluster]
# TTL 10
# Priority 0
# Timeout 100ms
# Fatal false
# Version 90400 ~ higher
# Source 330-pg_bgwriter.yml
#
# METRICS
# checkpoints_timed (COUNTER)
# Number of scheduled checkpoints that have been performed
# checkpoints_req (COUNTER)
# Number of requested checkpoints that have been performed
# checkpoint_write_time (COUNTER)
# Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in seconds
# checkpoint_sync_time (COUNTER)
# Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in seconds
# buffers_checkpoint (COUNTER)
# Number of buffers written during checkpoints
# buffers_clean (COUNTER)
# Number of buffers written by the background writer
# buffers_backend (COUNTER)
# Number of buffers written directly by a backend
# maxwritten_clean (COUNTER)
# Number of times the background writer stopped a cleaning scan because it had written too many buffers
# buffers_backend_fsync (COUNTER)
# Number of times a backend had to execute its own fsync call
# buffers_alloc (COUNTER)
# Number of buffers allocated
# reset_time (COUNTER)
# Time at which bgwriter statistics were last reset
#
pg_bgwriter_17:
name: pg_bgwriter
desc: "PostgreSQL background writer metrics PG 17+"
# https://pgpedia.info/p/pg_stat_bgwriter.html
query: SELECT buffers_clean, maxwritten_clean, buffers_alloc, extract(EPOCH FROM stats_reset) AS reset_time FROM pg_stat_bgwriter;
ttl: 10
min_version: 170000
tags:
- cluster
metrics:
- buffers_clean:
usage: COUNTER
description: Number of buffers written by the background writer
- maxwritten_clean:
usage: COUNTER
description: Number of times the background writer stopped a cleaning scan because it had written too many buffers
- buffers_alloc:
usage: COUNTER
description: Number of buffers allocated
- reset_time:
usage: COUNTER
description: Time at which bgwriter statistics were last reset
pg_bgwriter_16:
name: pg_bgwriter
desc: "PostgreSQL background writer metrics (PG17-)"
# https://pgpedia.info/p/pg_stat_bgwriter.html
query: SELECT checkpoints_timed, checkpoints_req, checkpoint_write_time, checkpoint_sync_time, buffers_checkpoint, buffers_clean, buffers_backend, maxwritten_clean, buffers_backend_fsync, buffers_alloc, extract(EPOCH FROM stats_reset) AS reset_time FROM pg_stat_bgwriter;
ttl: 10
min_version: 090400
max_version: 170000
tags:
- cluster
metrics:
- checkpoints_timed:
usage: COUNTER
description: Number of scheduled checkpoints that have been performed
- checkpoints_req:
usage: COUNTER
description: Number of requested checkpoints that have been performed
- checkpoint_write_time:
usage: COUNTER
scale: 1e-3
description: Total amount of time that has been spent in the portion of checkpoint processing where files are written to disk, in seconds
- checkpoint_sync_time:
usage: COUNTER
scale: 1e-3
description: Total amount of time that has been spent in the portion of checkpoint processing where files are synchronized to disk, in seconds
- buffers_checkpoint:
usage: COUNTER
description: Number of buffers written during checkpoints
- buffers_clean:
usage: COUNTER
description: Number of buffers written by the background writer
- buffers_backend:
usage: COUNTER
description: Number of buffers written directly by a backend
- maxwritten_clean:
usage: COUNTER
description: Number of times the background writer stopped a cleaning scan because it had written too many buffers
- buffers_backend_fsync:
usage: COUNTER
description: Number of times a backend had to execute its own fsync call
# Number of times a backend had to execute its own fsync call (normally the background writer handles those even when the backend does its own write)
- buffers_alloc:
usage: COUNTER
description: Number of buffers allocated
- reset_time:
usage: COUNTER
description: Time at which bgwriter statistics were last reset