From 9fce4e0e664fc35911f27a45e26033bc993bb8ba Mon Sep 17 00:00:00 2001 From: vinci <55838224+vinci-897@users.noreply.github.com> Date: Sat, 25 Mar 2023 10:08:33 +0800 Subject: [PATCH] [manager] enhance nacos.yml monitoring(#766) --- .../src/main/resources/define/app-nacos.yml | 85 ++++++++++++++----- 1 file changed, 62 insertions(+), 23 deletions(-) diff --git a/manager/src/main/resources/define/app-nacos.yml b/manager/src/main/resources/define/app-nacos.yml index 1554fa23272..814a19844f6 100644 --- a/manager/src/main/resources/define/app-nacos.yml +++ b/manager/src/main/resources/define/app-nacos.yml @@ -19,51 +19,90 @@ params: required: true defaultValue: 8848 metrics: - - name: cpu + - name: system priority: 0 fields: - field: system_cpu_usage type: 0 unit: '%' + - field: system_average_load + type: 0 + - field: system_memory_usage + type: 0 + unit: '%' + aliasFields: + - cpu + - load + - mem + calculates: + - system_cpu_usage=cpu * 100 + - system_average_load=load + - system_memory_usage=mem * 100 + protocol: http + http: + host: ^_^host^_^ + port: ^_^port^_^ + url: /nacos/v2/ns/operator/metrics?onlyStatus=false + method: GET + parseType: jsonPath + parseScript: $.data + + - name: jvm_gc_count + priority: 1 + fields: + - field: total_gc_count + type: 0 aliasFields: - value calculates: - - system_cpu_usage=value * 100 + - total_gc_count=value + protocol: http + http: + host: ^_^host^_^ + port: ^_^port^_^ + url: /nacos/actuator/metrics/jvm.gc.pause + method: GET + parseType: jsonPath + parseScript: $.measurements[0] + + - name: jvm_gc_time + priority: 1 + fields: + - field: total_gc_time + type: 0 + unit: 's' + aliasFields: + - value + calculates: + - total_gc_time=value protocol: http http: - # 主机host: ipv4 ipv6 域名 host: ^_^host^_^ - # 端口 port: ^_^port^_^ - # url请求接口路径 - url: /nacos/actuator/metrics/system.cpu.usage - # 请求方式 GET POST PUT DELETE PATCH + url: /nacos/actuator/metrics/jvm.gc.pause method: GET - # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-api可用性指标监控 parseType: jsonPath - parseScript: $.measurements[*] - - name: memory + parseScript: $.measurements[1] + + - name: nacos priority: 1 fields: - - field: jvm_memory_used + - field: service_count + type: 0 + - field: client_count type: 0 - unit: 'MB' aliasFields: - - value + - serviceCount + - clientCount calculates: - - jvm_memory_used=value - units: - - jvm_memory_used=B->MB + - service_count=serviceCount + - client_count=clientCount protocol: http http: - # 主机host: ipv4 ipv6 域名 host: ^_^host^_^ - # 端口 port: ^_^port^_^ - # url请求接口路径 - url: /nacos/actuator/metrics/jvm.memory.used - # 请求方式 GET POST PUT DELETE PATCH + url: /nacos/v2/ns/operator/metrics?onlyStatus=false method: GET - # 响应数据解析方式: default-系统规则,jsonPath-jsonPath脚本,website-api可用性指标监控 parseType: jsonPath - parseScript: $.measurements[*] + parseScript: $.data +