-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathapp-tidb.yml
More file actions
412 lines (401 loc) · 12.7 KB
/
app-tidb.yml
File metadata and controls
412 lines (401 loc) · 12.7 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
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring
category: db
# The monitoring type eg: linux windows tomcat mysql aws...
app: tidb
# The monitoring i18n name
name:
zh-CN: TiDB数据库
en-US: TiDB
ja-JP: TiDB データベース
# The description and help of this monitoring type
help:
zh-CN: HertzBeat 使用 HTTP 和 JDBC 协议对 TiDB 的通用性能指标进行采集监控,点击查看开启步骤</a>。<br>您可以点击“<i>新建 TiDB 数据库</i>”并进行配置,或者选择“<i>更多操作</i>”,导入已有配置。
en-US: HertzBeat monitors general performance metrics of TiDB through HTTP and JDBC protocol. <br> You could click the "<i>New TiDB</i>" button and proceed with the configuration or import an existing setup through the "<i>More Actions</i>".
zh-TW: HertzBeat 使用 HTTP 和 JDBC 協議對 TiDB 的通用性能指標進行採集監控,點擊查看開啟步驟</a>。 <br>您可以點擊“<i>新建 TiDB 數據庫</i>”並進行配置,或者選擇“<i>更多操作</i>”,導入已有配置。
ja-JP: Hertzbeat は HTTP と JDBCプロトコルを介して TiDB データベースの一般的なパフォーマンスのメトリクスを監視します。<br>「<i>新規 TiDB データベース</i>」をクリックしてパラメタを設定した後、新規することができます。
helpLink:
zh-CN: https://hertzbeat.apache.org/zh-cn/docs/help/tidb
en-US: https://hertzbeat.apache.org/docs/help/tidb
# Input params define for monitoring(render web ui by the definition)
params:
# field-param field key
- field: host
# name-param field display i18n name
name:
zh-CN: 目标Host
en-US: Target Host
ja-JP: 目標ホスト
# type-param field type(most mapping the html input type)
type: host
# required-true or false
required: true
# field-param field key
- field: port
# name-param field display i18n name
name:
zh-CN: JDBC 端口
en-US: JDBC Port
ja-JP: JDBCポート
# type-param field type(most mapping the html input type)
type: number
# when type is number, range is required
range: '[0,65535]'
# required-true or false
required: false
defaultValue: 4000
# hide param-true or false
hide: true
- field: service-port
name:
zh-CN: Service 端口
en-US: Service Port
ja-JP: サービスポート
type: number
range: '[0,65535]'
required: true
defaultValue: 10080
- field: pd-port
name:
zh-CN: PD 端口
en-US: PD Port
ja-JP: PDポート
type: number
range: '[0,65535]'
required: false
defaultValue: 2379
- field: timeout
name:
zh-CN: 查询超时时间(ms)
en-US: Query Timeout(ms)
ja-JP: クエリタイムアウト(ms)
type: number
required: false
defaultValue: 6000
- field: database
name:
zh-CN: 数据库名称
en-US: Database Name
ja-JP: データベース名
type: text
required: false
hide: true
- field: username
name:
zh-CN: 用户名
en-US: Username
ja-JP: ユーザー名
type: text
limit: 50
required: false
hide: true
- field: password
name:
zh-CN: 密码
en-US: Password
ja-JP: パスワード
type: password
required: false
hide: true
- field: url
name:
zh-CN: JDBC URL
en-US: JDBC URL
ja-JP: JDBC URL
type: text
required: false
hide: true
# collect metrics config list
metrics:
# metrics - status
- name: status
i18n:
zh-CN: 状态
en-US: Status
ja-JP: ステータス
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 0
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
- field: connections
type: 0
i18n:
zh-CN: 连接数
en-US: Connections
ja-JP: 接続数
- field: version
type: 1
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
- field: git_hash
type: 1
i18n:
zh-CN: Git Hash
en-US: Git Hash
ja-JP: Git Hash
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
http:
# http host: ipv4 ipv6 domain
host: ^_^host^_^
# http port
port: ^_^service-port^_^
# http url
url: '/status'
timeout: ^_^timeout^_^
# http method: GET POST PUT DELETE PATCH
method: GET
# http response data parse type: default-hertzbeat rule, jsonpath-jsonpath script, website-for website monitoring, prometheus-prometheus exporter rule
parseType: jsonPath
parseScript: '$'
- name: stores
i18n:
zh-CN: 存储
en-US: Stores
ja-JP: ストレージ
priority: 1
fields:
- field: address
type: 1
i18n:
zh-CN: 地址
en-US: Address
ja-JP: アドレス
- field: version
type: 1
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
- field: status_address
type: 1
i18n:
zh-CN: 状态地址
en-US: Status Address
ja-JP: ステータスアドレス
- field: deploy_path
type: 1
i18n:
zh-CN: 部署路径
en-US: Deploy Path
ja-JP: デプロイパス
- field: state_name
type: 1
i18n:
zh-CN: 状态名称
en-US: State Name
ja-JP: 状態名
- field: capacity
type: 1
i18n:
zh-CN: 容量
en-US: Capacity
ja-JP: 容量
- field: available
type: 1
i18n:
zh-CN: 可用
en-US: Available
ja-JP: 使用可能
- field: used_size
type: 1
i18n:
zh-CN: 已用
en-US: Used
ja-JP: 使用済み
- field: start_ts
type: 1
i18n:
zh-CN: 启动时间
en-US: Start Time
ja-JP: 起動時間
- field: last_heartbeat_ts
type: 1
i18n:
zh-CN: 上次心跳时间
en-US: Last Heartbeat Time
ja-JP: 最後のハートビート時間
- field: uptime
type: 1
i18n:
zh-CN: 启动时长
en-US: Uptime
ja-JP: アップタイム
aliasFields:
- $.store.address
- $.store.version
- $.store.status_address
- $.store.deploy_path
- $.store.state_name
- $.status.capacity
- $.status.available
- $.status.used_size
- $.status.start_ts
- $.status.last_heartbeat_ts
- $.status.uptime
calculates:
- address=$.store.address
- version=$.store.version
- status_address=$.store.status_address
- deploy_path=$.store.deploy_path
- state_name=$.store.state_name
- capacity=$.status.capacity
- available=$.status.available
- used_size=$.status.used_size
- start_ts=$.status.start_ts
- last_heartbeat_ts=$.status.last_heartbeat_ts
- uptime=$.status.uptime
protocol: http
http:
host: ^_^host^_^
port: ^_^pd-port^_^
url: '/pd/api/v1/stores'
timeout: ^_^timeout^_^
method: GET
parseType: jsonPath
parseScript: '$.stores.*'
- name: basic
i18n:
zh-CN: 基本信息
en-US: Basic Info
ja-JP: 基礎情報
# metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel
# priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue
priority: 2
# collect metrics content
fields:
# field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field
- field: version
type: 1
i18n:
zh-CN: 版本
en-US: Version
ja-JP: バージョン
label: true
- field: port
type: 1
i18n:
zh-CN: 端口
en-US: Port
ja-JP: ポート
- field: datadir
type: 1
i18n:
zh-CN: 数据目录
en-US: Data Directory
ja-JP: データディレクトリ
- field: max_connections
type: 0
i18n:
zh-CN: 最大连接数
en-US: Max Connections
ja-JP: 最大接続数
# (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field
aliasFields:
- version
- port
- datadir
- max_connections
# (optional)mapping and conversion expressions, use these and aliasField above to calculate metrics value
# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime
calculates:
- port=port
- datadir=datadir
- max_connections=max_connections
- version=version+"_"+version_compile_os+"_"+version_compile_machine
# the protocol used for monitoring, eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: jdbc
# the config content when protocol is jdbc
jdbc:
# host: ipv4 ipv6 host
host: ^_^host^_^
# port
port: ^_^port^_^
# database platform name
platform: mysql
username: ^_^username^_^
password: ^_^password^_^
database: ^_^database^_^
timeout: ^_^timeout^_^
# SQL Query Method:oneRow, multiRow, columns
queryType: columns
# sql
sql: show global variables where Variable_name like 'version%' or Variable_name = 'max_connections' or Variable_name = 'datadir' or Variable_name = 'port';
# JDBC url
url: ^_^url^_^
- name: account_expiry
priority: 14
i18n:
zh-CN: 账户过期信息
en-US: Account Expiry Info
ja-JP: アカウント有効期限情報
fields:
- field: user
type: 1
label: true
i18n:
zh-CN: 用户名
en-US: User
ja-JP: ユーザー名
- field: host
type: 1
label: true
i18n:
zh-CN: 主机
en-US: Host
ja-JP: ホスト
- field: password_expired
type: 1
i18n:
zh-CN: 密码是否过期
en-US: Password Expired
ja-JP: パスワード期限切れ
- field: password_lifetime
type: 0
unit: days
i18n:
zh-CN: 密码生命周期(天)
en-US: Password Lifetime (days)
ja-JP: パスワード有効期限(日)
- field: password_last_changed
type: 1
i18n:
zh-CN: 密码最后修改时间
en-US: Password Last Changed
ja-JP: パスワード最終変更
- field: days_until_expiry
type: 0
unit: days
i18n:
zh-CN: 距离过期天数
en-US: Days Until Expiry
ja-JP: 有効期限までの日数
protocol: jdbc
jdbc:
host: ^_^host^_^
port: ^_^port^_^
platform: mysql
username: ^_^username^_^
password: ^_^password^_^
database: ^_^database^_^
timeout: ^_^timeout^_^
queryType: multiRow
sql: SELECT User, Host, password_expired, IF(password_lifetime IS NULL OR password_lifetime = 0, 0, password_lifetime) as password_lifetime, password_last_changed, DATEDIFF(DATE_ADD(password_last_changed, INTERVAL IFNULL(password_lifetime, 0) DAY), CURDATE()) as days_until_expiry FROM mysql.user WHERE User != '' ORDER BY days_until_expiry ASC;
url: ^_^url^_^