Skip to content

Commit

Permalink
[manager] springboot2 monitor support base path config (#515)
Browse files Browse the repository at this point in the history
* [manager] springboot2 monitor support context path config

* [manager] springboot2 monitor support context path config
  • Loading branch information
tomsun28 authored Dec 24, 2022
1 parent 4c13a66 commit e072a40
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 37 deletions.
76 changes: 39 additions & 37 deletions manager/src/main/resources/define/app/app-springboot2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,14 @@ configmap:
type: 0
- key: ssl
type: 1
- key: base_path
type: 1
metrics:
- name: health
- name: environment
# 指标组调度优先级(0-127)越小优先级越高,优先级低的指标组会等优先级高的指标组采集完成后才会被调度,相同优先级的指标组会并行调度采集
# 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度
priority: 0
# 指标组中的具体监控指标
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: status
type: 1
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: /actuator/health
# 请求方式 GET POST PUT DELETE PATCH
method: GET
# 是否启用ssl/tls,即是http还是https,默认false
ssl: ^_^ssl^_^
# 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-api可用性指标监控
parseType: default

- name: enviroment
# 指标组调度优先级(0-127)越小优先级越高,优先级低的指标组会等优先级高的指标组采集完成后才会被调度,相同优先级的指标组会并行调度采集
# 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度
priority: 1
# 指标组中的具体监控指标
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: profile
Expand Down Expand Up @@ -95,7 +72,7 @@ metrics:
# 端口
port: ^_^port^_^
# url请求接口路径
url: /actuator/env
url: ^_^base_path^_^/env
# 请求方式 GET POST PUT DELETE PATCH
method: GET
# 是否启用ssl/tls,即是http还是https,默认false
Expand All @@ -106,7 +83,7 @@ metrics:

- name: thread_state
visible: false
priority: 2
priority: 1
fields:
- field: state
type: 1
Expand All @@ -117,7 +94,7 @@ metrics:
# 端口
port: ^_^port^_^
# url请求接口路径
url: /actuator/metrics/jvm.threads.states
url: ^_^base_path^_^/metrics/jvm.threads.states
# 请求方式 GET POST PUT DELETE PATCH
method: GET
# 是否启用ssl/tls,即是http还是https,默认false
Expand All @@ -127,7 +104,7 @@ metrics:
parseScript: '$.availableTags[?(@.tag == "state")].values[*]'

- name: threads
priority: 3
priority: 2
fields:
- field: state
type: 1
Expand All @@ -145,7 +122,7 @@ metrics:
# 端口
port: ^_^port^_^
# url请求接口路径
url: /actuator/metrics/jvm.threads.states?tag=state:^o^state^o^
url: ^_^base_path^_^/metrics/jvm.threads.states?tag=state:^o^state^o^
# 请求方式 GET POST PUT DELETE PATCH
method: GET
# 是否启用ssl/tls,即是http还是https,默认false
Expand All @@ -155,8 +132,8 @@ metrics:
parseScript: '$'

- name: space_name
visible: true
priority: 4
visible: false
priority: 3
fields:
- field: id
type: 1
Expand All @@ -167,7 +144,7 @@ metrics:
# 端口
port: ^_^port^_^
# url请求接口路径
url: /actuator/metrics/jvm.memory.used
url: ^_^base_path^_^/metrics/jvm.memory.used
# 请求方式 GET POST PUT DELETE PATCH
method: GET
# 是否启用ssl/tls,即是http还是https,默认false
Expand All @@ -177,7 +154,7 @@ metrics:
parseScript: '$.availableTags[?(@.tag == "id")].values[*]'

- name: memory_used
priority: 5
priority: 4
fields:
- field: space
type: 1
Expand All @@ -198,11 +175,36 @@ metrics:
# 端口
port: ^_^port^_^
# url请求接口路径
url: /actuator/metrics/jvm.memory.used?tag=id:^o^id^o^
url: ^_^base_path^_^/metrics/jvm.memory.used?tag=id:^o^id^o^
# 请求方式 GET POST PUT DELETE PATCH
method: GET
# 是否启用ssl/tls,即是http还是https,默认false
ssl: ^_^ssl^_^
# 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-api可用性指标监控
parseType: jsonPath
parseScript: '$'
parseScript: '$'

- name: health
# 指标组调度优先级(0-127)越小优先级越高,优先级低的指标组会等优先级高的指标组采集完成后才会被调度,相同优先级的指标组会并行调度采集
# 优先级为0的指标组为可用性指标组,即它会被首先调度,采集成功才会继续调度其它指标组,采集失败则中断调度
priority: 4
# 指标组中的具体监控指标
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: status
type: 1
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: ^_^base_path^_^/health
# 请求方式 GET POST PUT DELETE PATCH
method: GET
# 是否启用ssl/tls,即是http还是https,默认false
ssl: ^_^ssl^_^
# 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-api可用性指标监控
parseType: default
7 changes: 7 additions & 0 deletions manager/src/main/resources/define/param/param-springboot2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,10 @@ param:
# 当type为boolean时,前端用switch展示开关
type: boolean
required: false
- field: base_path
name:
zh-CN: Base Path
en-US: Base Path
type: text
defaultValue: /actuator
required: true

0 comments on commit e072a40

Please sign in to comment.