From 7ef2bebec2036994e7e8d5065859caa67b1cdd80 Mon Sep 17 00:00:00 2001 From: jiang1997 Date: Fri, 28 Oct 2022 16:56:44 +0800 Subject: [PATCH] feat: support Python runtime metrics --- docs/en/changes/changes.md | 2 + .../src/main/resources/application.yml | 2 +- .../meter-analyzer-config/python-runtime.yaml | 36 +++++ .../faas/faas-instance.json | 135 ++++++++++++++++++ .../general/general-instance.json | 135 ++++++++++++++++++ 5 files changed, 309 insertions(+), 1 deletion(-) create mode 100644 oap-server/server-starter/src/main/resources/meter-analyzer-config/python-runtime.yaml diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md index 3200fa1bfbb1..e4430696d48e 100644 --- a/docs/en/changes/changes.md +++ b/docs/en/changes/changes.md @@ -72,6 +72,7 @@ * gRPC stream canceling code is not logged as an error when the client cancels the stream. The client cancels the stream when the pod is terminated. * Do not log error logs when failed to create ElasticSearch index because the index is created already. +* Support Python runtime metrics analysis. #### UI @@ -104,6 +105,7 @@ * Add `readRecords` to metric types. * Verify dashboard names for new dashboards. * Associate metrics with the trace widget on dashboards. +* Add Python runtime metrics and cpu/memory utilization panels to General-Instance and Fass-Instance dashboards #### Documentation diff --git a/oap-server/server-starter/src/main/resources/application.yml b/oap-server/server-starter/src/main/resources/application.yml index fba48e31e26b..7113f3573b0c 100644 --- a/oap-server/server-starter/src/main/resources/application.yml +++ b/oap-server/server-starter/src/main/resources/application.yml @@ -248,7 +248,7 @@ agent-analyzer: # Nginx and Envoy agents can't get the real remote address. # Exit spans with the component in the list would not generate the client-side instance relation metrics. noUpstreamRealAddressAgents: ${SW_NO_UPSTREAM_REAL_ADDRESS:6000,9000} - meterAnalyzerActiveFiles: ${SW_METER_ANALYZER_ACTIVE_FILES:datasource,threadpool,satellite,go-runtime} # Which files could be meter analyzed, files split by "," + meterAnalyzerActiveFiles: ${SW_METER_ANALYZER_ACTIVE_FILES:datasource,threadpool,satellite,go-runtime, python-runtime} # Which files could be meter analyzed, files split by "," slowCacheReadThreshold: ${SW_SLOW_CACHE_SLOW_READ_THRESHOLD:default:20,redis:10} # The slow cache write operation thresholds. Unit ms. slowCacheWriteThreshold: ${SW_SLOW_CACHE_SLOW_WRITE_THRESHOLD:default:20,redis:10} # The slow cache write operation thresholds. Unit ms. diff --git a/oap-server/server-starter/src/main/resources/meter-analyzer-config/python-runtime.yaml b/oap-server/server-starter/src/main/resources/meter-analyzer-config/python-runtime.yaml new file mode 100644 index 000000000000..0e902a62056b --- /dev/null +++ b/oap-server/server-starter/src/main/resources/meter-analyzer-config/python-runtime.yaml @@ -0,0 +1,36 @@ +# 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. + +expSuffix: instance(['service'], ['instance'], Layer.GENERAL) +metricPrefix: meter +metricsRules: + - name: instance_pvm_process_cpu_utilization + exp: instance_pvm_process_cpu_utilization + - name: instance_pvm_process_mem_utilization + exp: instance_pvm_process_mem_utilization + - name: instance_pvm_total_cpu_utilization + exp: instance_pvm_total_cpu_utilization + - name: instance_pvm_total_mem_utilization + exp: instance_pvm_total_mem_utilization + - name: instance_pvm_gc_g0 + exp: instance_pvm_gc_g0 + - name: instance_pvm_gc_g1 + exp: instance_pvm_gc_g1 + - name: instance_pvm_gc_g2 + exp: instance_pvm_gc_g2 + - name: instance_pvm_gc_time + exp: instance_pvm_gc_time.increase("PT1M") + - name: instance_pvm_thread_active_count + exp: instance_pvm_thread_active_count \ No newline at end of file diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/faas/faas-instance.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/faas/faas-instance.json index 13bafaa705da..9a5ad9c9b806 100644 --- a/oap-server/server-starter/src/main/resources/ui-initialized-templates/faas/faas-instance.json +++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/faas/faas-instance.json @@ -392,6 +392,141 @@ "moved": false } ] + }, + { + "name": "PVM", + "children": [ + { + "x": 0, + "y": 0, + "w": 8, + "h": 13, + "i": "24", + "type": "Widget", + "widget": { + "title": "Host CPU Utilization / PVM CPU Utilization (%)" + }, + "graph": { + "type":"Area", + "opacity":0.4, + "showXAxis":true, + "showYAxis":true + }, + "metrics": [ + "meter_instance_pvm_total_cpu_utilization", + "meter_instance_pvm_process_cpu_utilization" + ], + "metricTypes": [ + "readMetricsValues", + "readMetricsValues" + ], + "moved": false + }, + { + "x": 8, + "y": 0, + "w": 8, + "h": 13, + "i": "16", + "type": "Widget", + "widget": { + "title": "PVM Thread Count" + }, + "graph": { + "type":"Line", + "step":false, + "smooth":false, + "showSymbol":false, + "showXAxis":true, + "showYAxis":true + }, + "metrics": [ + "meter_instance_pvm_thread_active_count" + ], + "metricTypes": [ + "readMetricsValues" + ], + "moved": false + }, + { + "x": 16, + "y": 0, + "w": 8, + "h": 13, + "i": "17", + "type": "Widget", + "widget": { + "title": "PVM GC Count" + }, + "graph": { + "type":"Bar", + "showBackground":true + }, + "metrics": [ + "meter_instance_pvm_gc_g0", + "meter_instance_pvm_gc_g1", + "meter_instance_pvm_gc_g2" + ], + "metricTypes": [ + "readMetricsValues", + "readMetricsValues", + "readMetricsValues" + ], + "moved": false + }, + { + "x": 0, + "y": 13, + "w": 8, + "h": 13, + "i": "18", + "type": "Widget", + "widget": { + "title": "Host Mem Utilization / PVM Mem Utilization (%)" + }, + "graph": { + "type":"Area", + "opacity":0.4, + "showXAxis":true, + "showYAxis":true + }, + "metrics": [ + "meter_instance_pvm_total_mem_utilization", + "meter_instance_pvm_process_mem_utilization" + ], + "metricTypes": [ + "readMetricsValues", + "readMetricsValues" + ], + "moved": false + }, + { + "x": 8, + "y": 13, + "w": 8, + "h": 13, + "i": "19", + "type": "Widget", + "widget": { + "title": "PVM GC Time (ms)" + }, + "graph": { + "type":"Line", + "step":false, + "smooth":false, + "showSymbol":false, + "showXAxis":true, + "showYAxis":true + }, + "metrics": [ + "meter_instance_pvm_gc_time" + ], + "metricTypes": [ + "readMetricsValues" + ], + "moved": false + } + ] } ] }, diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/general/general-instance.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/general/general-instance.json index 71f11f661266..9bdc4c333585 100644 --- a/oap-server/server-starter/src/main/resources/ui-initialized-templates/general/general-instance.json +++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/general/general-instance.json @@ -1232,6 +1232,141 @@ "moved": false } ] + }, + { + "name": "PVM", + "children": [ + { + "x": 0, + "y": 0, + "w": 8, + "h": 13, + "i": "24", + "type": "Widget", + "widget": { + "title": "Host CPU Utilization / PVM CPU Utilization (%)" + }, + "graph": { + "type":"Area", + "opacity":0.4, + "showXAxis":true, + "showYAxis":true + }, + "metrics": [ + "meter_instance_pvm_total_cpu_utilization", + "meter_instance_pvm_process_cpu_utilization" + ], + "metricTypes": [ + "readMetricsValues", + "readMetricsValues" + ], + "moved": false + }, + { + "x": 8, + "y": 0, + "w": 8, + "h": 13, + "i": "16", + "type": "Widget", + "widget": { + "title": "PVM Thread Count" + }, + "graph": { + "type":"Line", + "step":false, + "smooth":false, + "showSymbol":false, + "showXAxis":true, + "showYAxis":true + }, + "metrics": [ + "meter_instance_pvm_thread_active_count" + ], + "metricTypes": [ + "readMetricsValues" + ], + "moved": false + }, + { + "x": 16, + "y": 0, + "w": 8, + "h": 13, + "i": "17", + "type": "Widget", + "widget": { + "title": "PVM GC Count" + }, + "graph": { + "type":"Bar", + "showBackground":true + }, + "metrics": [ + "meter_instance_pvm_gc_g0", + "meter_instance_pvm_gc_g1", + "meter_instance_pvm_gc_g2" + ], + "metricTypes": [ + "readMetricsValues", + "readMetricsValues", + "readMetricsValues" + ], + "moved": false + }, + { + "x": 0, + "y": 13, + "w": 8, + "h": 13, + "i": "18", + "type": "Widget", + "widget": { + "title": "Host Mem Utilization / PVM Mem Utilization (%)" + }, + "graph": { + "type":"Area", + "opacity":0.4, + "showXAxis":true, + "showYAxis":true + }, + "metrics": [ + "meter_instance_pvm_total_mem_utilization", + "meter_instance_pvm_process_mem_utilization" + ], + "metricTypes": [ + "readMetricsValues", + "readMetricsValues" + ], + "moved": false + }, + { + "x": 8, + "y": 13, + "w": 8, + "h": 13, + "i": "19", + "type": "Widget", + "widget": { + "title": "PVM GC Time (ms)" + }, + "graph": { + "type":"Line", + "step":false, + "smooth":false, + "showSymbol":false, + "showXAxis":true, + "showYAxis":true + }, + "metrics": [ + "meter_instance_pvm_gc_time" + ], + "metricTypes": [ + "readMetricsValues" + ], + "moved": false + } + ] } ] },