[monitor] 完成查询监控类型的参数结构,新增和查询监控接口编码
This commit is contained in:
105
manager/src/main/resources/define/app/A-example.yml
Normal file
105
manager/src/main/resources/define/app/A-example.yml
Normal file
@@ -0,0 +1,105 @@
|
||||
# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws...
|
||||
app: cloud
|
||||
# 参数映射map. type是参数类型: number数字, string明文字符串, secret加密字符串
|
||||
# 强制固定必须参数 - host
|
||||
configmap:
|
||||
- key: host
|
||||
type: 1
|
||||
- key: port
|
||||
type: 0
|
||||
- key: username
|
||||
type: 1
|
||||
- key: password
|
||||
type: 2
|
||||
- key: param1
|
||||
type: 1
|
||||
# 指标组列表
|
||||
metrics:
|
||||
# 第一个监控指标组 cpu
|
||||
- name: cpu
|
||||
# 指标组调度优先级(0-127)越小优先级越高,优先级低的指标组会等优先级高的指标组采集完成后才会被调度,相同优先级的指标组会并行调度采集
|
||||
# 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度
|
||||
priority: 0
|
||||
# 指标组中的具体监控指标
|
||||
fields:
|
||||
# 指标信息 包括 field名称, type字段类型:number数字,string字符串, unit:指标单位
|
||||
- field: usage
|
||||
type: number
|
||||
unit: '%'
|
||||
- field: cores
|
||||
type: number
|
||||
- field: waitime
|
||||
type: number
|
||||
unit: s
|
||||
# (非必须)监控指标别名,与上面的指标名映射。用于采集接口数据字段不直接是最终指标名称,需要此别名做映射转换
|
||||
aliasFields:
|
||||
- core1
|
||||
- core2
|
||||
- usage
|
||||
- allTime
|
||||
- runningTime
|
||||
# (非必须)指标计算表达式,与上面的别名一起作用,计算出最终需要的指标值
|
||||
# eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime
|
||||
calculates:
|
||||
- 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: /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-系统规则,json_path-jsonPath脚本,xml_path-xmlPath脚本,prometheus-Prometheus数据规则
|
||||
parseType: jsonPath
|
||||
parseScript: '$.cpu[:1].*'
|
||||
|
||||
- name: memory
|
||||
priority: 1
|
||||
fields:
|
||||
- field: total
|
||||
type: number
|
||||
unit: kb
|
||||
- field: usage
|
||||
type: number
|
||||
unit: '%'
|
||||
- field: speed
|
||||
type: number
|
||||
protocol: http
|
||||
http:
|
||||
host: ^_^host^_^
|
||||
port: ^_^port^_^
|
||||
url: /memory
|
||||
method: GET
|
||||
headers:
|
||||
apiVersion: v1
|
||||
params:
|
||||
param1: param1
|
||||
param2: param2
|
||||
authorization:
|
||||
type: Basic Auth
|
||||
basicAuthUsername: ^_^username^_^
|
||||
basicAuthPassword: ^_^password^_^
|
||||
parseType: jsonPath
|
||||
parseScript: '$.memory[:1].*'
|
||||
Reference in New Issue
Block a user