-
Notifications
You must be signed in to change notification settings - Fork 45
/
120-pg_meta.yml
204 lines (199 loc) · 6.25 KB
/
120-pg_meta.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
##
# SYNOPSIS
# pg_meta_*
#
# DESCRIPTION
# PostgreSQL meta info
#
# OPTIONS
# Tags [cluster]
# TTL 10
# Priority 0
# Timeout 100ms
# Fatal false
# Version 90600 ~ 130000
# Source 120-pg_meta.yml
#
# METRICS
# cluster_id (LABEL)
# cluster system identifier
# cluster_name (LABEL)
# cluster name
# listen_port (LABEL)
# listen port
# data_dir (LABEL)
# data directory path
# conf_path (LABEL)
# postgresql.conf path
# hba_path (LABEL)
# pg_hba.conf path
# wal_level (LABEL)
# wal level
# version (LABEL)
# server version in human-readable format
# ver_num (LABEL)
# server version number in machine-readable format
# extensions (LABEL)
# server installed preload libraries
# primary_conninfo (LABEL)
# connection string to upstream (do not set password here)
# info (GAUGE)
# constant 1
#
pg_meta:
name: pg_meta
desc: PostgreSQL meta info
query: |
SELECT (SELECT system_identifier FROM pg_control_system()) AS cluster_id,
current_setting('cluster_name') AS cluster_name,
current_setting('port') AS listen_port,
current_setting('data_directory') AS data_dir,
current_setting('config_file') AS conf_path,
current_setting('hba_file') AS hba_path,
current_setting('wal_level') AS wal_level,
current_setting('server_version') AS version,
current_setting('server_version_num') AS ver_num,
current_setting('shared_preload_libraries') AS extensions,
'N/A' AS primary_conninfo,
1 AS info
ttl: 10
min_version: 090600
max_version: 130000
tags:
- cluster
metrics:
- cluster_id:
usage: LABEL
description: cluster system identifier
- cluster_name:
usage: LABEL
description: cluster name
- listen_port:
usage: LABEL
description: listen port
- data_dir:
usage: LABEL
description: data directory path
- conf_path:
usage: LABEL
description: postgresql.conf path
- hba_path:
usage: LABEL
description: pg_hba.conf path
- wal_level:
usage: LABEL
description: wal level
- version:
usage: LABEL
description: server version in human-readable format
- ver_num:
usage: LABEL
description: server version number in machine-readable format
- extensions:
usage: LABEL
description: server installed preload libraries
- primary_conninfo:
usage: LABEL
description: connection string to upstream (do not set password here)
- info:
usage: GAUGE
description: constant 1
##
# SYNOPSIS
# pg_meta.pg_meta_13_*
#
# DESCRIPTION
# PostgreSQL meta info for pg 13, with extra primary conninfo
#
# OPTIONS
# Tags [cluster]
# TTL 10
# Priority 0
# Timeout 100ms
# Fatal false
# Version 130000 ~ higher
# Source 120-pg_meta.yml
#
# METRICS
# cluster_id (LABEL)
# cluster system identifier
# cluster_name (LABEL)
# cluster name
# listen_port (LABEL)
# listen port
# data_dir (LABEL)
# data directory path
# conf_path (LABEL)
# postgresql.conf path
# hba_path (LABEL)
# pg_hba.conf path
# wal_level (LABEL)
# wal level
# version (LABEL)
# server version in human-readable format
# ver_num (LABEL)
# server version number in machine-readable format
# extensions (LABEL)
# server installed preload libraries
# primary_conninfo (LABEL)
# connection string to upstream (do not set password here)
# info (GAUGE)
# constant 1
#
pg_meta_13:
name: pg_meta
desc: PostgreSQL meta info for pg 13, with extra primary conninfo
query: |
SELECT (SELECT system_identifier FROM pg_control_system()) AS cluster_id,
current_setting('cluster_name') AS cluster_name,
current_setting('port') AS listen_port,
current_setting('data_directory') AS data_dir,
current_setting('config_file') AS conf_path,
current_setting('hba_file') AS hba_path,
current_setting('wal_level') AS wal_level,
current_setting('server_version') AS version,
current_setting('server_version_num') AS ver_num,
current_setting('shared_preload_libraries') AS extensions,
current_setting('primary_conninfo') AS primary_conninfo,
1 AS info
ttl: 10
min_version: 130000
tags:
- cluster
metrics:
- cluster_id:
usage: LABEL
description: cluster system identifier
- cluster_name:
usage: LABEL
description: cluster name
- listen_port:
usage: LABEL
description: listen port
- data_dir:
usage: LABEL
description: data directory path
- conf_path:
usage: LABEL
description: postgresql.conf path
- hba_path:
usage: LABEL
description: pg_hba.conf path
- wal_level:
usage: LABEL
description: wal level
- version:
usage: LABEL
description: server version in human-readable format
- ver_num:
usage: LABEL
description: server version number in machine-readable format
- extensions:
usage: LABEL
description: server installed preload libraries
- primary_conninfo:
usage: LABEL
description: connection string to upstream (do not set password here)
- info:
usage: GAUGE
description: constant 1