Skip to content

Commit

Permalink
[manager] support apache shenyu metrics monitoring (#507)
Browse files Browse the repository at this point in the history
  prometheus exporter metrics parser

  prometheus exporter metrics parser

  prometheus exporter metrics parser

  prometheus exporter metrics parser

  optimize ExporterParser.java

  optimize ExporterParser.java

  optimize ExporterParser.java

  handle INF parser

  添加iotdb的exporter方式监听

  [manager] iotdb monitor add cluster_node_status metric

  [manager] fix actuator mail health check error when startup

  [manager] use prometheus instead of prometheus_exporter

  [manager] add iotdb monitoring metrics

  [collector] add metric type - info, update parser

  [collector] update

  [manager] support monitoring apache shenyu gateway

Co-authored-by: Ceilzcx <1758619238@qq.com>
  • Loading branch information
tomsun28 and Ceilzcx authored Dec 20, 2022
1 parent 655134d commit 18737ce
Show file tree
Hide file tree
Showing 2 changed files with 325 additions and 0 deletions.
286 changes: 286 additions & 0 deletions manager/src/main/resources/define/app/app-shenyu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
# 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.

category: mid
app: shenyu
name:
zh-CN: ShenYu网关
en-US: ShenYu
# 参数映射map. type是参数类型: 0-number数字, 1-string明文字符串, 2-secret加密字符串
# 强制固定必须参数 - host
configmap:
- key: host
type: 1
- key: port
type: 0
- key: timeout
type: 0
# 指标组列表
metrics:
- name: shenyu_request_total
priority: 0
fields:
- field: value
type: 0
# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: ''
timeout: ^_^timeout^_^
method: GET
parseType: prometheus

- name: shenyu_request_throw_created
priority: 1
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: value
type: 0
# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: ''
timeout: ^_^timeout^_^
method: GET
parseType: prometheus

- name: process_cpu_seconds_total
priority: 1
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: value
type: 0
unit: s
# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: ''
timeout: ^_^timeout^_^
method: GET
parseType: prometheus

- name: process_open_fds
priority: 1
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: value
type: 0
# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: ''
timeout: ^_^timeout^_^
method: GET
parseType: prometheus

- name: process_max_fds
priority: 1
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: value
type: 0
# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: ''
timeout: ^_^timeout^_^
method: GET
parseType: prometheus

- name: jvm_info
priority: 1
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: runtime
type: 1
- field: vendor
type: 1
- field: version
type: 1
# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: ''
timeout: ^_^timeout^_^
method: GET
parseType: prometheus

- name: jvm_memory_bytes_used
priority: 1
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: area
type: 1
instance: true
- field: value
type: 0
unit: MB
units:
- value=B->MB
# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: ''
timeout: ^_^timeout^_^
method: GET
parseType: prometheus

- name: jvm_memory_pool_bytes_used
priority: 1
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: pool
type: 1
instance: true
- field: value
type: 0
unit: MB
units:
- value=B->MB
# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: ''
timeout: ^_^timeout^_^
method: GET
parseType: prometheus

- name: jvm_memory_pool_bytes_committed
priority: 1
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: pool
type: 1
instance: true
- field: value
type: 0
unit: MB
units:
- value=B->MB
# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: ''
timeout: ^_^timeout^_^
method: GET
parseType: prometheus

- name: jvm_memory_pool_bytes_max
priority: 1
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: pool
type: 1
instance: true
- field: value
type: 0
unit: MB
units:
- value=B->MB
# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: ''
timeout: ^_^timeout^_^
method: GET
parseType: prometheus

- name: jvm_threads_state
priority: 1
fields:
# 指标信息 包括 field名称 type字段类型:0-number数字,1-string字符串 instance是否为实例主键 unit:指标单位
- field: state
type: 1
instance: true
- field: count
type: 0
aliasFields:
- state
- value
calculates:
- count=value
# 监控采集使用协议 eg: sql, ssh, http, telnet, wmi, snmp, sdk
protocol: http
# 当protocol为http协议时具体的采集配置
http:
# 主机host: ipv4 ipv6 域名
host: ^_^host^_^
# 端口
port: ^_^port^_^
# url请求接口路径
url: ''
timeout: ^_^timeout^_^
method: GET
parseType: prometheus
39 changes: 39 additions & 0 deletions manager/src/main/resources/define/param/param-shenyu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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.

app: shenyu
param:
- field: host
name:
zh-CN: 主机Host
en-US: Host
type: host
required: true
- field: port
name:
zh-CN: 端口
en-US: Port
type: number
range: '[0,65535]'
defaultValue: 8090
required: true
- field: timeout
name:
zh-CN: 查询超时时间
en-US: Query Timeout
type: number
required: false
hide: true
defaultValue: 6000

0 comments on commit 18737ce

Please sign in to comment.