diff --git a/collector/src/main/java/com/usthe/collector/collect/database/JdbcCommonCollect.java b/collector/src/main/java/com/usthe/collector/collect/database/JdbcCommonCollect.java
index 0a7eaea..1f86ffc 100644
--- a/collector/src/main/java/com/usthe/collector/collect/database/JdbcCommonCollect.java
+++ b/collector/src/main/java/com/usthe/collector/collect/database/JdbcCommonCollect.java
@@ -204,7 +204,7 @@ public class JdbcCommonCollect extends AbstractCollect {
* 查询多行数据, 通过查询返回结果集的列名称,和查询的字段映射
* eg:
* 查询字段:one tow three four
- * 查询SQL:select one, tow, three, four from book limit 1;
+ * 查询SQL:select one, tow, three, four from book;
* @param statement 执行器
* @param sql sql
* @param columns 查询的列头(一般是数据库表字段,也可能包含特殊字段,eg: responseTime)
diff --git a/home/docs/advanced/extend-http-default.md b/home/docs/advanced/extend-http-default.md
new file mode 100644
index 0000000..ad72562
--- /dev/null
+++ b/home/docs/advanced/extend-http-default.md
@@ -0,0 +1,132 @@
+---
+id: extend-http-default
+title: HTTP协议系统默认解析方式
+sidebar_label: 系统默认解析方式
+---
+> HTTP接口调用获取响应数据后,用HertzBeat默认的解析方式去解析响应数据。
+
+**此需接口响应数据结构符合HertzBeat指定的数据结构规则**
+
+### HertzBeat数据格式规范
+注意⚠️ 响应数据为JSON
+
+单层格式:key-value
+```json
+{
+ "metricName1": "metricValue",
+ "metricName2": "metricValue",
+ "metricName3": "metricValue",
+ "metricName4": "metricValue"
+}
+```
+多层格式:数组里面套key-value
+```json
+[
+ {
+ "metricName1": "metricValue",
+ "metricName2": "metricValue",
+ "metricName3": "metricValue",
+ "metricName4": "metricValue"
+ },
+ {
+ "metricName1": "metricValue",
+ "metricName2": "metricValue",
+ "metricName3": "metricValue",
+ "metricName4": "metricValue"
+ }
+]
+```
+样例:
+查询自定义系统的CPU信息,其暴露接口为 `/metrics/cpu`,我们需要其中的`hostname,core,useage`指标
+若只有一台虚拟机,其单层格式为:
+```json
+{
+ "hostname": "linux-1",
+ "core": 1,
+ "usage": 78.0,
+ "allTime": 200,
+ "runningTime": 100
+}
+```
+若有多台虚拟机,其多层格式为:
+```json
+[
+ {
+ "hostname": "linux-1",
+ "core": 1,
+ "usage": 78.0,
+ "allTime": 200,
+ "runningTime": 100
+ },
+ {
+ "hostname": "linux-2",
+ "core": 3,
+ "usage": 78.0,
+ "allTime": 566,
+ "runningTime": 34
+ },
+ {
+ "hostname": "linux-3",
+ "core": 4,
+ "usage": 38.0,
+ "allTime": 500,
+ "runningTime": 20
+ }
+]
+```
+
+**对应的监控配置定义文件YML可以配置为如下**
+
+```yaml
+# 此监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
+category: custom
+# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
+app: example
+name:
+ zh-CN: 模拟应用类型
+ en-US: EXAMPLE APP
+# 参数映射map. 这些为输入参数变量,即可以用^_^host^_^的形式写到后面的配置中,系统自动变量值替换
+# type是参数类型: 0-number数字, 1-string明文字符串, 2-secret加密字符串
+# 强制固定必须参数 - host
+configmap:
+ - key: host
+ type: 1
+ - key: port
+ type: 0
+# 指标组列表
+metrics:
+# 第一个监控指标组 cpu
+# 注意:内置监控指标有 (responseTime - 响应时间)
+ - name: cpu
+ # 指标组调度优先级(0-127)越小优先级越高,优先级低的指标组会等优先级高的指标组采集完成后才会被调度,相同优先级的指标组会并行调度采集
+ # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度
+ priority: 0
+ # 指标组中的具体监控指标
+ fields:
+ # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
+ - field: hostname
+ type: 1
+ instance: true
+ - field: usage
+ type: 0
+ unit: '%'
+ - field: core
+ type: 0
+# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
+ protocol: http
+# 当protocol为http协议时具体的采集配置
+ http:
+ # 主机host: ipv4 ipv6 域名
+ host: ^_^host^_^
+ # 端口
+ port: ^_^port^_^
+ # url请求接口路径
+ url: /metrics/cpu
+ # 请求方式 GET POST PUT DELETE PATCH
+ method: GET
+ # 是否启用ssl/tls,即是http还是https,默认false
+ ssl: false
+ # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控
+ # 这里使用HertzBeat默认解析
+ parseType: default
+```
diff --git a/home/docs/advanced/extend-http-jsonpath.md b/home/docs/advanced/extend-http-jsonpath.md
new file mode 100644
index 0000000..ccf931e
--- /dev/null
+++ b/home/docs/advanced/extend-http-jsonpath.md
@@ -0,0 +1,149 @@
+---
+id: extend-http-jsonpath
+title: HTTP协议JsonPath解析方式
+sidebar_label: JsonPath解析方式
+---
+> HTTP接口调用获取响应数据后,用JsonPath脚本解析的解析方式去解析响应数据。
+
+注意⚠️ 响应数据为JSON格式
+
+**使用JsonPath脚本将响应数据解析成符合HertzBeat指定的数据结构规则的数据**
+
+#### JsonPath操作符
+[JSONPath在线验证](https://www.jsonpath.cn)
+
+| JSONPATH | 帮助描述 |
+| ----------- | ----------- |
+| $ | 根对象或元素 |
+| @ | 当前对象或元素 |
+| . or [] | 子元素操作符 |
+| .. | 递归匹配所有子元素 |
+| * | 通配符. 匹配所有对象或元素. |
+| [] | 下标运算符,JsonPath索引从0开始 |
+| [,] | 连接运算符,将多个结果拼成数组返回,JSONPath允许使用别名. |
+| [start:end:step] | 数组切片运算符 |
+| ?() | 过滤器(脚本)表达式. |
+| () | 脚本表达式. |
+
+#### HertzBeat数据格式规范
+单层格式:key-value
+```json
+{
+ "metricName1": "metricValue",
+ "metricName2": "metricValue",
+ "metricName3": "metricValue",
+ "metricName4": "metricValue"
+}
+```
+多层格式:数组里面套key-value
+```json
+[
+ {
+ "metricName1": "metricValue",
+ "metricName2": "metricValue",
+ "metricName3": "metricValue",
+ "metricName4": "metricValue"
+ },
+ {
+ "metricName1": "metricValue",
+ "metricName2": "metricValue",
+ "metricName3": "metricValue",
+ "metricName4": "metricValue"
+ }
+]
+```
+
+#### 样例
+
+查询自定义系统的数值信息,其暴露接口为 `/metrics/person`,我们需要其中的`type,num`指标
+接口返回的原始数据如下:
+```json
+{
+ "firstName": "John",
+ "lastName" : "doe",
+ "age" : 26,
+ "address" : {
+ "streetAddress": "naist street",
+ "city" : "Nara",
+ "postalCode" : "630-0192"
+ },
+ "number": [
+ {
+ "type": "core",
+ "num": 3343
+ },
+ {
+ "type": "home",
+ "num": 4543
+ }
+ ]
+}
+```
+
+我们使用JsonPath脚本解析,对应的脚本为: `$.number[*]` ,解析后的数据结构如下:
+```json
+[
+ {
+ "type": "core",
+ "num": 3343
+ },
+ {
+ "type": "home",
+ "num": 4543
+ }
+]
+```
+此数据结构符合HertzBeat的数据格式规范,成功提取指标`type,num`值。
+
+**对应的监控配置定义文件YML可以配置为如下**
+
+```yaml
+# 此监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
+category: custom
+# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
+app: example
+name:
+ zh-CN: 模拟应用类型
+ en-US: EXAMPLE APP
+# 参数映射map. 这些为输入参数变量,即可以用^_^host^_^的形式写到后面的配置中,系统自动变量值替换
+# type是参数类型: 0-number数字, 1-string明文字符串, 2-secret加密字符串
+# 强制固定必须参数 - host
+configmap:
+ - key: host
+ type: 1
+ - key: port
+ type: 0
+# 指标组列表
+metrics:
+# 第一个监控指标组 person
+# 注意:内置监控指标有 (responseTime - 响应时间)
+ - name: cpu
+ # 指标组调度优先级(0-127)越小优先级越高,优先级低的指标组会等优先级高的指标组采集完成后才会被调度,相同优先级的指标组会并行调度采集
+ # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度
+ priority: 0
+ # 指标组中的具体监控指标
+ fields:
+ # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
+ - field: type
+ type: 1
+ instance: true
+ - field: num
+ type: 0
+# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
+ protocol: http
+# 当protocol为http协议时具体的采集配置
+ http:
+ # 主机host: ipv4 ipv6 域名
+ host: ^_^host^_^
+ # 端口
+ port: ^_^port^_^
+ # url请求接口路径
+ url: /metrics/person
+ # 请求方式 GET POST PUT DELETE PATCH
+ method: GET
+ # 是否启用ssl/tls,即是http还是https,默认false
+ ssl: false
+ # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控
+ # 这里使用jsonPath解析
+ parseType: $.number[*]
+```
diff --git a/home/docs/advanced/extend-http.md b/home/docs/advanced/extend-http.md
new file mode 100644
index 0000000..4e1dcd8
--- /dev/null
+++ b/home/docs/advanced/extend-http.md
@@ -0,0 +1,215 @@
+---
+id: extend-http
+title: HTTP协议自定义监控
+sidebar_label: HTTP协议自定义监控
+---
+> 从[自定义监控](extend-point)了解熟悉了怎么自定义类型,指标,协议等,这里我们来详细介绍下用HTTP协议自定义指标监控。
+
+### HTTP协议采集流程
+【**HTTP接口调用**】->【**响应校验**】->【**响应数据解析**】->【**默认方式解析|JsonPath脚本解析 | XmlPath解析(todo) | Prometheus解析(todo)**】->【**指标数据提取**】
+
+由流程可见,我们自定义一个HTTP协议的监控类型,需要配置HTTP请求参数,配置获取哪些指标,对响应数据配置解析方式和解析脚本。
+HTTP协议支持我们自定义HTTP请求路径,请求header,请求参数,请求方式,请求体等。
+
+**系统默认解析方式**:http接口返回hertzbeat规定的json数据结构,即可用默认解析方式解析数据提取对应的指标数据,详细介绍见 [**系统默认解析**](extend-http-default)
+**JsonPath脚本解析方式**:用JsonPath脚本对响应的json数据进行解析,返回系统指定的数据结构,然后提供对应的指标数据,详细介绍见 [**JsonPath脚本解析**](extend-http-jsonpath)
+
+
+### 自定义步骤
+
+配置自定义监控类型需新增配置两个YML文件
+1. 用监控类型命名的监控配置定义文件 - 例如:example.yml 需位于安装目录 /hertzbeat/define/app/ 下
+2. 用监控类型命名的监控参数定义文件 - 例如:example.yml 需位于安装目录 /hertzbeat/define/param/ 下
+3. 重启hertzbeat系统,我们就适配好了一个新的自定义监控类型。
+
+-------
+下面详细介绍下这俩文件的配置用法,请注意看使用注释。
+
+### 监控配置定义文件
+
+> 监控配置定义文件用于定义 *监控类型的名称(国际化), 请求参数映射, 指标信息, 采集协议配置信息*等。
+
+样例:自定义一个名称为example的自定义监控类型,其使用HTTP协议采集指标数据。
+文件名称: example.yml 位于 /define/app/example.yml
+
+```yaml
+# 此监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
+category: custom
+# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
+app: example
+name:
+ zh-CN: 模拟应用类型
+ en-US: EXAMPLE APP
+# 参数映射map. 这些为输入参数变量,即可以用^_^host^_^的形式写到后面的配置中,系统自动变量值替换
+# type是参数类型: 0-number数字, 1-string明文字符串, 2-secret加密字符串
+# 强制固定必须参数 - host
+configmap:
+ - key: host
+ type: 1
+ - key: port
+ type: 0
+ - key: username
+ type: 1
+ - key: password
+ type: 2
+# 指标组列表
+metrics:
+# 第一个监控指标组 cpu
+# 注意:内置监控指标有 (responseTime - 响应时间)
+ - name: cpu
+ # 指标组调度优先级(0-127)越小优先级越高,优先级低的指标组会等优先级高的指标组采集完成后才会被调度,相同优先级的指标组会并行调度采集
+ # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度
+ priority: 0
+ # 指标组中的具体监控指标
+ fields:
+ # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
+ - field: hostname
+ type: 1
+ instance: true
+ - field: usage
+ type: 0
+ unit: '%'
+ - field: cores
+ type: 0
+ - field: waitTime
+ type: 0
+ unit: s
+# (非必须)监控指标别名,与上面的指标名映射。用于采集接口数据字段不直接是最终指标名称,需要此别名做映射转换
+ aliasFields:
+ - hostname
+ - core1
+ - core2
+ - usage
+ - allTime
+ - runningTime
+# (非必须)指标计算表达式,与上面的别名一起作用,计算出最终需要的指标值
+# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime
+ calculates:
+ - hostname=hostname
+ - cores=core1+core2
+ - usage=usage
+ - waitTime=allTime-runningTime
+# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
+ protocol: http
+# 当protocol为http协议时具体的采集配置
+ http:
+ # 主机host: ipv4 ipv6 域名
+ host: ^_^host^_^
+ # 端口
+ port: ^_^port^_^
+ # url请求接口路径
+ url: /metrics/cpu
+ # 请求方式 GET POST PUT DELETE PATCH
+ method: GET
+ # 是否启用ssl/tls,即是http还是https,默认false
+ ssl: false
+ # 请求头内容
+ headers:
+ apiVersion: v1
+ # 请求参数内容
+ params:
+ param1: param1
+ param2: param2
+ # 认证
+ authorization:
+ # 认证方式: Basic Auth, Digest Auth, Bearer Token
+ type: Basic Auth
+ basicAuthUsername: ^_^username^_^
+ basicAuthPassword: ^_^password^_^
+ # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-网站可用性指标监控
+ # todo xmlPath-xmlPath脚本,prometheus-Prometheus数据规则
+ parseType: jsonPath
+ parseScript: '$'
+
+ - name: memory
+ priority: 1
+ fields:
+ - field: hostname
+ type: 1
+ instance: true
+ - field: total
+ type: 0
+ unit: kb
+ - field: usage
+ type: 0
+ unit: '%'
+ - field: speed
+ type: 0
+ protocol: http
+ http:
+ host: ^_^host^_^
+ port: ^_^port^_^
+ url: /metrics/memory
+ method: GET
+ headers:
+ apiVersion: v1
+ params:
+ param1: param1
+ param2: param2
+ authorization:
+ type: Basic Auth
+ basicAuthUsername: ^_^username^_^
+ basicAuthPassword: ^_^password^_^
+ parseType: default
+```
+
+### 监控参数定义文件
+
+> 监控参数定义文件用于定义 *需要的输入参数字段结构定义(前端页面根据结构渲染输入参数框)*。
+
+样例:自定义一个名称为example的自定义监控类型,其使用HTTP协议采集指标数据。
+文件名称: example.yml 位于 //define/param/example.yml
+
+```yaml
+# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws...
+app: example
+# 强制固定必须参数 - host(ipv4,ipv6,域名)
+param:
+ # field-字段名称标识符
+ - field: host
+ # name-参数字段显示名称
+ name: 主机Host
+ # type-字段类型,样式(大部分映射input标签type属性)
+ type: host
+ # 是否是必输项 true-必填 false-可选
+ required: true
+ - field: port
+ name: 端口
+ type: number
+ # 当type为number时,用range表示范围
+ range: '[0,65535]'
+ required: true
+ # 端口默认值
+ defaultValue: 80
+ # 参数输入框提示信息
+ placeholder: '请输入端口'
+ - field: username
+ name: 用户名
+ type: text
+ # 当type为text时,用limit表示字符串限制大小
+ limit: 20
+ required: false
+ - field: password
+ name: 密码
+ type: password
+ required: false
+ - field: ssl
+ name: 启动SSL
+ # 当type为boolean时,前端用switch展示开关
+ type: boolean
+ required: false
+ - field: method
+ name: 请求方式
+ type: radio
+ required: true
+ # 当type为radio单选框,checkbox复选框时,option表示可选项值列表 {name1:value1,name2:value2}
+ options:
+ - label: GET请求
+ value: GET
+ - label: POST请求
+ value: POST
+ - label: PUT请求
+ value: PUT
+ - label: DELETE请求
+ value: DELETE
+```
diff --git a/home/docs/advanced/extend-mysql.md b/home/docs/advanced/extend-mysql.md
new file mode 100644
index 0000000..ad3cdc8
--- /dev/null
+++ b/home/docs/advanced/extend-mysql.md
@@ -0,0 +1,252 @@
+---
+id: extend-mysql
+title: MYSQL协议自定义监控
+sidebar_label: MYSQL协议自定义监控
+---
+> 从[自定义监控](extend-point)了解熟悉了怎么自定义类型,指标,协议等,这里我们来详细介绍下用MYSQL协议自定义指标监控。
+> mysql协议自定义监控可以让我们很方便的通过写SQL查询语句就能监控到我们想监控的指标
+
+### MYSQL协议采集流程
+【**系统直连MYSQL**】->【**运行SQL查询语句**】->【**响应数据解析:oneRow, multiRow, columns**】->【**指标数据提取**】
+
+由流程可见,我们自定义一个MYSQL协议的监控类型,需要配置MYSQL请求参数,配置获取哪些指标,配置查询SQL语句。
+
+### 数据解析方式
+SQL查询回来的数据字段和我们需要的指标映射,就能获取对应的指标数据,目前映射解析方式有三种:oneRow, multiRow, columns
+
+#### **oneRow**
+> 查询一行数据, 通过查询返回结果集的列名称,和查询的字段映射
+
+例如:
+查询的指标字段为:one tow three four
+查询SQL:select one, tow, three, four from book limit 1;
+这里指标字段就能和响应数据一一映射为一行采集数据。
+
+#### **multiRow**
+> 查询多行数据, 通过查询返回结果集的列名称,和查询的字段映射
+
+例如:
+查询的指标字段为:one tow three four
+查询SQL:select one, tow, three, four from book;
+这里指标字段就能和响应数据一一映射为多行采集数据。
+
+#### **columns**
+> 采集一行指标数据, 通过查询的两列数据(key-value),key和查询的字段匹配,value为查询字段的值
+
+例如:
+查询字段:one tow three four
+查询SQL:select key, value from book;
+SQL响应数据:
+
+| key | value |
+| ----------- | ----------- |
+| one | 243 |
+| two | 435 |
+| three | 332 |
+| four | 643 |
+
+这里指标字段就能和响应数据的key映射,获取对应的value为其采集监控数据。
+
+### 自定义步骤
+
+配置自定义监控类型需新增配置两个YML文件
+1. 用监控类型命名的监控配置定义文件 - 例如:example.yml 需位于安装目录 /hertzbeat/define/app/ 下
+2. 用监控类型命名的监控参数定义文件 - 例如:example.yml 需位于安装目录 /hertzbeat/define/param/ 下
+3. 重启hertzbeat系统,我们就适配好了一个新的自定义监控类型。
+
+-------
+下面详细介绍下这俩文件的配置用法,请注意看使用注释。
+
+### 监控配置定义文件
+
+> 监控配置定义文件用于定义 *监控类型的名称(国际化), 请求参数映射, 指标信息, 采集协议配置信息*等。
+
+样例:自定义一个名称为example的自定义监控类型,其使用HTTP协议采集指标数据。
+文件名称: example.yml 位于 /define/app/example.yml
+
+```yaml
+# 此监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
+category: db
+# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
+app: example
+name:
+ zh-CN: 模拟MYSQL应用类型
+ en-US: MYSQL EXAMPLE APP
+# 参数映射map. 这些为输入参数变量,即可以用^_^host^_^的形式写到后面的配置中,系统自动变量值替换
+# type是参数类型: 0-number数字, 1-string明文字符串, 2-secret加密字符串
+# 强制固定必须参数 - host
+configmap:
+ - key: host
+ type: 1
+ - key: port
+ type: 0
+ - key: username
+ type: 1
+ - key: password
+ type: 2
+ - key: database
+ type: 1
+ - key: url
+ type: 1
+# 指标组列表
+metrics:
+ - name: basic
+ # 指标组调度优先级(0-127)越小优先级越高,优先级低的指标组会等优先级高的指标组采集完成后才会被调度,相同优先级的指标组会并行调度采集
+ # 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度
+ priority: 0
+ # 指标组中的具体监控指标
+ fields:
+ # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
+ - field: version
+ type: 1
+ instance: true
+ - field: port
+ type: 1
+ - field: datadir
+ type: 1
+ - field: max_connections
+ type: 0
+ # (非必须)监控指标别名,与上面的指标名映射。用于采集接口数据字段不直接是最终指标名称,需要此别名做映射转换
+ aliasFields:
+ - version
+ - version_compile_os
+ - version_compile_machine
+ - port
+ - datadir
+ - max_connections
+ # (非必须)指标计算表达式,与上面的别名一起作用,计算出最终需要的指标值
+ # 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
+ protocol: jdbc
+ jdbc:
+ # 主机host: ipv4 ipv6 域名
+ host: ^_^host^_^
+ # 端口
+ port: ^_^port^_^
+ platform: mysql
+ username: ^_^username^_^
+ password: ^_^password^_^
+ database: ^_^database^_^
+ # SQL查询方式: 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';
+ url: ^_^url^_^
+
+ - name: status
+ priority: 1
+ fields:
+ # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
+ - field: threads_created
+ type: 0
+ - field: threads_connected
+ type: 0
+ - field: threads_cached
+ type: 0
+ - field: threads_running
+ type: 0
+ # (非必须)监控指标别名,与上面的指标名映射。用于采集接口数据字段不直接是最终指标名称,需要此别名做映射转换
+ aliasFields:
+ - threads_created
+ - threads_connected
+ - threads_cached
+ - threads_running
+ # (非必须)指标计算表达式,与上面的别名一起作用,计算出最终需要的指标值
+ # eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime
+ calculates:
+ - threads_created=threads_created
+ - threads_connected=threads_connected
+ - threads_cached=threads_cached
+ - threads_running=threads_running
+ protocol: jdbc
+ jdbc:
+ # 主机host: ipv4 ipv6 域名
+ host: ^_^host^_^
+ # 端口
+ port: ^_^port^_^
+ platform: mysql
+ username: ^_^username^_^
+ password: ^_^password^_^
+ database: ^_^database^_^
+ # SQL查询方式: oneRow, multiRow, columns
+ queryType: columns
+ # sql
+ sql: show global status where Variable_name like 'thread%' or Variable_name = 'com_commit' or Variable_name = 'com_rollback' or Variable_name = 'questions' or Variable_name = 'uptime';
+ url: ^_^url^_^
+
+ - name: innodb
+ priority: 2
+ fields:
+ # 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
+ - field: innodb_data_reads
+ type: 0
+ unit: 次数
+ - field: innodb_data_writes
+ type: 0
+ unit: 次数
+ - field: innodb_data_read
+ type: 0
+ unit: kb
+ - field: innodb_data_written
+ type: 0
+ unit: kb
+ protocol: jdbc
+ jdbc:
+ # 主机host: ipv4 ipv6 域名
+ host: ^_^host^_^
+ # 端口
+ port: ^_^port^_^
+ platform: mysql
+ username: ^_^username^_^
+ password: ^_^password^_^
+ database: ^_^database^_^
+ # SQL查询方式: oneRow, multiRow, columns
+ queryType: columns
+ # sql
+ sql: show global status where Variable_name like 'innodb%';
+ url: ^_^url^_^
+```
+
+### 监控参数定义文件
+
+> 监控参数定义文件用于定义 *需要的输入参数字段结构定义(前端页面根据结构渲染输入参数框)*。
+
+样例:自定义一个名称为example的自定义监控类型,其使用HTTP协议采集指标数据。
+文件名称: example.yml 位于 /define/param/example.yml
+
+```yaml
+app: example
+param:
+ - field: host
+ name: 主机Host
+ type: host
+ required: true
+ - field: port
+ name: 端口
+ type: number
+ range: '[0,65535]'
+ required: true
+ defaultValue: 80
+ placeholder: '请输入端口'
+ - field: database
+ name: 数据库名称
+ type: text
+ required: false
+ - field: username
+ name: 用户名
+ type: text
+ limit: 20
+ required: false
+ - field: password
+ name: 密码
+ type: password
+ required: false
+ - field: url
+ name: URL
+ type: text
+ required: false
+```
diff --git a/home/docs/advanced/extend-point.md b/home/docs/advanced/extend-point.md
index 2cf9417..2ed31d0 100644
--- a/home/docs/advanced/extend-point.md
+++ b/home/docs/advanced/extend-point.md
@@ -3,13 +3,14 @@ id: extend-point
title: 自定义监控
sidebar_label: 自定义监控
---
-> HertzBeat拥有自定义监控能力,您只需配置两个YML文件就能适配一款自定义的监控类型。目前自定义监控支持HTTP协议,MYSQL协议,后续会支持更多通用协议。
+> HertzBeat拥有自定义监控能力,您只需配置两个YML文件就能适配一款自定义的监控类型。
+> 目前自定义监控支持[HTTP协议](extend-http),MYSQL协议,后续会支持更多通用协议(ssh telnet wmi snmp)。
### 自定义步骤
配置自定义监控类型需新增配置两个YML文件
-1. 用监控类型命名的监控配置定义文件 - example.yml 需位于安装目录 /hertzbeat/define/app/ 下
-2. 用监控类型命名的监控参数定义文件 - example.yml 需位于安装目录 /hertzbeat/define/param/ 下
+1. 用监控类型命名的监控配置定义文件 - 例如:example.yml 需位于安装目录 /hertzbeat/define/app/ 下
+2. 用监控类型命名的监控参数定义文件 - 例如:example.yml 需位于安装目录 /hertzbeat/define/param/ 下
3. 重启hertzbeat系统,我们就适配好了一个新的自定义监控类型。
-------
@@ -20,15 +21,18 @@ sidebar_label: 自定义监控
> 监控配置定义文件用于定义 *监控类型的名称(国际化), 请求参数映射, 指标信息, 采集协议配置信息*等。
样例:自定义一个名称为example的自定义监控类型,其使用HTTP协议采集指标数据。
-文件名称: example.yml 位于 //define/app/example.yml
+文件名称: example.yml 位于 /define/app/example.yml
```yaml
+# 此监控类型所属类别:service-应用服务监控 db-数据库监控 custom-自定义监控 os-操作系统监控
+category: custom
# 监控应用类型(与文件名保持一致) eg: linux windows tomcat mysql aws...
app: example
name:
zh-CN: 模拟应用类型
en-US: EXAMPLE APP
-# 参数映射map. type是参数类型: 0-number数字, 1-string明文字符串, 2-secret加密字符串
+# 参数映射map. 这些为输入参数变量,即可以用^_^host^_^的形式写到后面的配置中,系统自动变量值替换
+# type是参数类型: 0-number数字, 1-string明文字符串, 2-secret加密字符串
# 强制固定必须参数 - host
configmap:
- key: host
@@ -145,7 +149,7 @@ metrics:
> 监控参数定义文件用于定义 *需要的输入参数字段结构定义(前端页面根据结构渲染输入参数框)*。
样例:自定义一个名称为example的自定义监控类型,其使用HTTP协议采集指标数据。
-文件名称: example.yml 位于 //define/param/example.yml
+文件名称: example.yml 位于 /define/param/example.yml
```yaml
# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws...
diff --git a/home/docs/help/alert_threshold.md b/home/docs/help/alert_threshold.md
new file mode 100644
index 0000000..42a711c
--- /dev/null
+++ b/home/docs/help/alert_threshold.md
@@ -0,0 +1,36 @@
+---
+id: alert_threshold
+title: 阈值告警配置
+sidebar_label: 阈值告警配置
+---
+
+> 对监控指标配置告警阈值(警告告警,严重告警,紧急告警),系统根据阈值配置和采集指标数据计算触发告警。
+
+### 操作步骤
+
+1. **【告警配置】->【新增阈值】-> 【配置后确定】**
+
+
+
+如上图:
+
+**指标对象**:选择我们需要配置阈值的监控指标对象 例如:网站监控类型下的 -> summary指标集合下的 -> responseTime响应时间指标
+**阈值触发表达式**:根据此表达式来计算判断是否触发阈值,表达式环境变量和操作符见页面提示,例如:设置响应时间大于50触发告警,表达式为 `responseTime > 50`。阈值表达式详细帮助见 [阈值表达式帮助](alert_threshold_expr)
+**告警级别**:触发阈值的告警级别,从低到高依次为:警告-warning,严重-critical,紧急-emergency
+**触发次数**:设置触发阈值多少次之后才会真正的触发告警
+**通知模版**:告警触发后发送的通知信息模版,模版环境变量见页面提示,例如:`${app}.${metrics}.${metric}指标的值为${responseTime},大于50触发告警`
+**全局默认**: 设置此阈值是否对全局的此类指标都应用有效,默认否。新增阈值后还需将阈值与监控对象关联,这样阈值才会对此监控生效。
+**启用告警**:此告警阈值配置开启生效或关闭
+
+2. ** 阈值关联监控⚠️ 【告警配置】-> 【将刚设置的阈值】-> 【配置关联监控】-> 【配置后确定】**
+
+> ** 注意⚠️ 新增阈值后还需将阈值与监控对象关联(即设置此阈值对哪些监控有效),这样阈值才会对此监控生效 **。
+
+
+
+
+
+**阈值告警配置完毕,已经被成功触发的告警信息可以在【告警中心】看到。**
+**若需要将告警信息邮件,微信,钉钉飞书通知给相关人员,可以在【告警通知】配置。**
+
+其它问题可以通过交流群ISSUE反馈哦!
diff --git a/home/docs/help/alert_threshold_expr.md b/home/docs/help/alert_threshold_expr.md
new file mode 100644
index 0000000..f6a1675
--- /dev/null
+++ b/home/docs/help/alert_threshold_expr.md
@@ -0,0 +1,49 @@
+---
+id: alert_threshold_expr
+title: 阈值触发表达式
+sidebar_label: 阈值触发表达式
+---
+
+> 在我们配置阈值告警时,需要配置阈值触发表达式,系统根据表达式和监控指标值计算触发是否告警,这里详细介绍下表达式使用。
+
+#### 表达式支持的操作符
+
+```
+equals(str1,str2)
+==
+<
+<=
+>
+>=
+!=
+( )
++
+-
+&&
+||
+```
+
+丰富的操作符让我们可以很自由的定义表达式。
+注意⚠️ 字符串的相等请用 `equals(str1,str2)` 数字类型的相等判断请用== 或 !=
+
+#### 支持的环境变量
+> 环境变量即指标值等支持的变量,用于在表达式中,阈值计算判断时会将变量替换成实际值进行计算
+
+非固定环境变量:这些变量会根据我们选择的监控指标对象而动态变化,例如我们选择了**网站监控的响应时间指标**,则环境变量就有 `responseTime - 此为响应时间变量`
+如果我们想设置**网站监控的响应时间大于400时**触发告警,则表达式为 `responseTime>400`
+
+固定环境变量(不常用):`instance : 所属行实例值`
+此变量主要用于计算多实例时,比如采集到c盘d盘的`usage`(`usage为非固定环境变量`),我们只想设置**c盘的usage大于80**时告警,则表达式为 `equals(instance,"c")&&usage>80`
+
+#### 表达式设置案例
+
+1. 网站监控->响应时间大于等于400ms时触发告警
+`responseTime>=400`
+2. API监控->响应时间大于3000ms时触发告警
+`responseTime>3000`
+3. 全站监控->URL(instance)路径为 `https://baidu.com/book/3` 的响应时间大于200ms时触发告警
+`equals(instance,"https://baidu.com/book/3")&&responseTime>200`
+4. MYSQL监控->status指标组->threads_running(运行线程数)指标大于7时触发告警
+`threads_running>7`
+
+若遇到问题可以通过交流群ISSUE交流反馈哦!
diff --git a/home/sidebars.json b/home/sidebars.json
index 4a7f2a4..36945e0 100644
--- a/home/sidebars.json
+++ b/home/sidebars.json
@@ -16,7 +16,23 @@
"type": "category",
"label": "自定义监控",
"items": [
- "advanced/extend-point"
+ "advanced/extend-point",
+ {
+ "type": "category",
+ "label": "HTTP协议",
+ "items": [
+ "advanced/extend-http",
+ "advanced/extend-http-default",
+ "advanced/extend-http-jsonpath"
+ ]
+ },
+ {
+ "type": "category",
+ "label": "MYSQL协议",
+ "items": [
+ "advanced/extend-mysql"
+ ]
+ }
]
},
{
@@ -42,6 +58,14 @@
"help/mysql"
]
},
+ {
+ "type": "category",
+ "label": "阈值告警配置",
+ "items": [
+ "help/alert_threshold",
+ "help/alert_threshold_expr"
+ ]
+ },
{
"type": "category",
"label": "告警通知配置",
diff --git a/home/static/img/docs/help/alert-threshold-1.png b/home/static/img/docs/help/alert-threshold-1.png
new file mode 100644
index 0000000..e2458b8
Binary files /dev/null and b/home/static/img/docs/help/alert-threshold-1.png differ
diff --git a/home/static/img/docs/help/alert-threshold-2.png b/home/static/img/docs/help/alert-threshold-2.png
new file mode 100644
index 0000000..f1ab6a4
Binary files /dev/null and b/home/static/img/docs/help/alert-threshold-2.png differ
diff --git a/home/static/img/docs/help/alert-threshold-3.png b/home/static/img/docs/help/alert-threshold-3.png
new file mode 100644
index 0000000..3da7696
Binary files /dev/null and b/home/static/img/docs/help/alert-threshold-3.png differ
diff --git a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html
index 7313a7e..16a0f62 100644
--- a/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html
+++ b/web-app/src/app/routes/alert/alert-notice/alert-notice.component.html
@@ -9,6 +9,10 @@
告警通知配置
+
+ 帮助
+
+
diff --git a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html
index 81662aa..92d6fba 100644
--- a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html
+++ b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html
@@ -9,6 +9,10 @@
告警阈值配置
+
+ 帮助
+
+
diff --git a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html
index 609407d..f923738 100644
--- a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html
+++ b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html
@@ -15,6 +15,10 @@
修改 {{ 'monitor.app.' + monitor.app | i18n }} 监控
+
+ 帮助
+
+
diff --git a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html
index 0a22eb9..ca551f5 100644
--- a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html
+++ b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html
@@ -15,6 +15,10 @@
新增 {{ 'monitor.app.' + monitor.app | i18n }} 监控
+
+ 帮助
+
+