From 1899b3969d296ff3b6f6827446b1be942838ad59 Mon Sep 17 00:00:00 2001 From: Mrproliu <741550557@qq.com> Date: Thu, 20 Jul 2023 19:49:55 +0800 Subject: [PATCH 1/2] Update Golang instance metrics UI template for adapt Go Agent metrics reporter --- docs/en/changes/changes.md | 1 + .../meter-analyzer-config/go-runtime.yaml | 48 ++- .../general/general-instance.json | 309 ++++++++++++++---- 3 files changed, 287 insertions(+), 71 deletions(-) diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md index 391424959d86..9b3108982277 100644 --- a/docs/en/changes/changes.md +++ b/docs/en/changes/changes.md @@ -50,6 +50,7 @@ * Apply MQE on Virtual-Cache layer UI-templates * Add Echo component ID(5015) language: Golang. * Fix `index out of bounds exception` in `aggregate_labels` MQE function. +* Update Golang instance tab under the general service dashboard UI template for adapt Go Agent metrics reporter. #### UI diff --git a/oap-server/server-starter/src/main/resources/meter-analyzer-config/go-runtime.yaml b/oap-server/server-starter/src/main/resources/meter-analyzer-config/go-runtime.yaml index b2b723225f1f..61883bb5c16d 100644 --- a/oap-server/server-starter/src/main/resources/meter-analyzer-config/go-runtime.yaml +++ b/oap-server/server-starter/src/main/resources/meter-analyzer-config/go-runtime.yaml @@ -31,4 +31,50 @@ metricsRules: - name: instance_host_cpu_used_rate exp: instance_host_cpu_used_rate - name: instance_host_mem_used_rate - exp: instance_host_mem_used_rate \ No newline at end of file + exp: instance_host_mem_used_rate + - name: instance_golang_heap_alloc_rate + exp: instance_golang_heap_alloc_size.increase('PT1M') + - name: instance_golang_gc_count_labeled + exp: instance_golang_gc_count_labeled.sum(['service', 'instance', 'type']).increase('PT1M') + - name: instance_golang_heap_alloc_objects + exp: instance_golang_heap_alloc_objects + - name: instance_golang_heap_frees + exp: instance_golang_heap_frees.increase('PT1M') + - name: instance_golang_heap_frees_objects + exp: instance_golang_heap_frees_objects.increase('PT1M') + - name: instance_golang_memory_heap_labeled + exp: instance_golang_memory_heap_labeled.sum(['service', 'instance', 'type']) + - name: instance_golang_metadata_mcache_labeled + exp: instance_golang_metadata_mcache_labeled.sum(['service', 'instance', 'type']) + - name: instance_golang_metadata_mspan_labeled + exp: instance_golang_metadata_mspan_labeled.sum(['service', 'instance', 'type']) + - name: instance_golang_cgo_calls + exp: instance_golang_cgo_calls.increase('PT1M') + - name: instance_golang_gc_heap_goal + exp: instance_golang_gc_heap_goal + - name: instance_golang_gc_heap_objects + exp: instance_golang_gc_heap_objects + - name: instance_golang_gc_heap_tiny_allocs + exp: instance_golang_gc_heap_tiny_allocs + - name: instance_golang_gc_limiter_last_enabled + exp: instance_golang_gc_limiter_last_enabled + - name: instance_golang_gc_stack_starting_size + exp: instance_golang_gc_stack_starting_size + - name: instance_golang_memory_metadata_other + exp: instance_golang_memory_metadata_other + - name: instance_golang_memory_os_stacks + exp: instance_golang_memory_os_stacks + - name: instance_golang_memory_other + exp: instance_golang_memory_other + - name: instance_golang_memory_profiling_buckets + exp: instance_golang_memory_profiling_buckets + - name: instance_golang_memory_total + exp: instance_golang_memory_total + - name: instance_golang_gc_heap_allocs_by_size + exp: instance_golang_gc_heap_allocs_by_size.histogram().histogram_percentile([50,70,90,99]).downsampling(SUM) + - name: instance_golang_gc_heap_frees_by_size + exp: instance_golang_gc_heap_frees_by_size.histogram().histogram_percentile([50,70,90,99]).downsampling(SUM) + - name: instance_golang_gc_pauses + exp: instance_golang_gc_pauses.histogram().histogram_percentile([50,70,90,99]).downsampling(SUM) + - name: instance_golang_sched_latencies + exp: instance_golang_sched_latencies.histogram().histogram_percentile([50,70,90,99]).downsampling(SUM) \ No newline at end of file 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 2a371d7ded76..633de7bb874f 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 @@ -1135,26 +1135,31 @@ "name": "Golang", "children": [ { - "x": 0, - "y": 0, + "x": 8, + "y": 12, "w": 8, - "h": 13, - "i": "24", + "h": 12, + "i": "17", "type": "Widget", "widget": { - "title": "Heap Alloc (MB)" + "title": "GC Pause Time Per Minute (milliseconds)" }, "graph": { "type": "Line", "step": false, "smooth": false, - "showSymbol": true, + "showSymbol": false, "showXAxis": true, "showYAxis": true }, + "metricConfig": [ + { + "calculation": "nanosecondToMillisecond" + } + ], "metricMode": "Expression", "expressions": [ - "meter_instance_golang_heap_alloc/1048576" + "meter_instance_golang_gc_pauses/1000000" ], "typesOfMQE": [ "TIME_SERIES_VALUES" @@ -1164,11 +1169,11 @@ "x": 8, "y": 0, "w": 8, - "h": 13, - "i": "16", + "h": 12, + "i": "19", "type": "Widget", "widget": { - "title": "Stack Used (MB)" + "title": "Live Threads Num" }, "graph": { "type": "Line", @@ -1179,35 +1184,52 @@ "showYAxis": true }, "metricMode": "Expression", + "metricConfig": [ + { + "label": "OS Thread Count" + }, + { + "label": "GoRoutine Count" + } + ], "expressions": [ - "meter_instance_golang_stack_used/1048576" + "meter_instance_golang_live_goroutines_num" ], "typesOfMQE": [ "TIME_SERIES_VALUES" + ], + "metrics": [ + "meter_instance_golang_os_threads_num", + "meter_instance_golang_live_goroutines_num" + ], + "metricTypes": [ + "readMetricsValues", + "readMetricsValues" ] }, { - "x": 16, - "y": 0, + "x": 0, + "y": 48, "w": 8, - "h": 13, - "i": "17", + "h": 12, + "i": "22", "type": "Widget", "widget": { - "title": "Golang GC Pause Time Per Minute (ms)" + "title": "Metadata Mspan (MB)" }, "graph": { "type": "Bar", "showBackground": true }, + "metricMode": "Expression", "metricConfig": [ { - "label": "pause_time" + "label": "host_mem_used_rate", + "calculation": "byteToMB" } ], - "metricMode": "Expression", "expressions": [ - "meter_instance_golang_gc_pause_time" + "meter_instance_golang_metadata_mspan_labeled" ], "typesOfMQE": [ "TIME_SERIES_VALUES" @@ -1215,82 +1237,134 @@ }, { "x": 0, - "y": 13, + "y": 12, "w": 8, - "h": 13, - "i": "18", + "h": 12, + "i": "25", "type": "Widget", - "widget": { - "title": "Golang GC Count Per Minute" - }, "graph": { - "type": "Bar", - "showBackground": true + "type": "Line", + "step": false, + "smooth": false, + "showSymbol": false, + "showXAxis": true, + "showYAxis": true }, - "metrics": [ - "meter_instance_golang_gc_count" + "widget": { + "title": "GC Count Per Minute" + }, + "metricMode": "Expression", + "expressions": [ + "meter_instance_golang_gc_count_labeled" ], - "metricTypes": [ - "readMetricsValues" + "typesOfMQE": [ + "TIME_SERIES_VALUES" ] }, { "x": 8, - "y": 13, + "y": 24, "w": 8, - "h": 13, - "i": "19", + "h": 12, + "i": "26", "type": "Widget", + "graph": { + "type": "Line", + "step": false, + "smooth": false, + "showSymbol": false, + "showXAxis": true, + "showYAxis": true + }, "widget": { - "title": "Live Goroutines Num" + "title": "Heap Alloc Size Per Minutes (MB)" }, + "metricMode": "Expression", + "expressions": [ + "meter_instance_golang_heap_alloc_rate/1024/1024" + ], + "typesOfMQE": [ + "TIME_SERIES_VALUES" + ] + }, + { + "x": 16, + "y": 0, + "w": 8, + "h": 12, + "i": "27", + "type": "Widget", "graph": { "type": "Line", "step": false, "smooth": false, - "showSymbol": true, + "showSymbol": false, "showXAxis": true, "showYAxis": true }, - "metricMode": "Expression", + "widget": { + "title": "GoRoutine Schedule Time (millisecond)" + }, "metricConfig": [ { - "label": "live_goroutines_num" + "unit": "Millisecond" } ], + "metricMode": "Expression", "expressions": [ - "meter_instance_golang_live_goroutines_num" + "meter_instance_golang_sched_latencies/1000000" ], "typesOfMQE": [ "TIME_SERIES_VALUES" ] }, { - "x": 16, - "y": 13, + "x": 0, + "y": 24, "w": 8, - "h": 13, - "i": "20", + "h": 12, + "i": "28", "type": "Widget", + "graph": { + "type": "Line", + "step": false, + "smooth": false, + "showSymbol": false, + "showXAxis": true, + "showYAxis": true + }, "widget": { - "title": "Golang OS Threads Num" + "title": "GC Free Size Per Minute (MB)" }, + "metricMode": "Expression", + "expressions": [ + "meter_instance_golang_heap_frees/1024/1024" + ], + "typesOfMQE": [ + "TIME_SERIES_VALUES" + ] + }, + { + "x": 8, + "y": 36, + "w": 8, + "h": 12, + "i": "29", + "type": "Widget", "graph": { "type": "Line", "step": false, "smooth": false, - "showSymbol": true, + "showSymbol": false, "showXAxis": true, "showYAxis": true }, + "widget": { + "title": "Alloc Size Per Minute (KB)" + }, "metricMode": "Expression", - "metricConfig": [ - { - "label": "os_threads_num" - } - ], "expressions": [ - "meter_instance_golang_os_threads_num" + "meter_instance_golang_gc_heap_allocs_by_size/1024" ], "typesOfMQE": [ "TIME_SERIES_VALUES" @@ -1298,30 +1372,51 @@ }, { "x": 0, - "y": 26, + "y": 36, "w": 8, - "h": 13, - "i": "21", + "h": 12, + "i": "30", "type": "Widget", + "graph": { + "type": "Line", + "step": false, + "smooth": false, + "showSymbol": false, + "showXAxis": true, + "showYAxis": true + }, "widget": { - "title": "Host CPU Used Rate (%)" + "title": "Free Size Per Minute (KB)" }, + "metricMode": "Expression", + "expressions": [ + "meter_instance_golang_gc_heap_frees_by_size/1024" + ], + "typesOfMQE": [ + "TIME_SERIES_VALUES" + ] + }, + { + "x": 16, + "y": 24, + "w": 8, + "h": 12, + "i": "31", + "type": "Widget", "graph": { "type": "Line", "step": false, "smooth": false, - "showSymbol": true, + "showSymbol": false, "showXAxis": true, "showYAxis": true }, + "widget": { + "title": "Heap Object Count" + }, "metricMode": "Expression", - "metricConfig": [ - { - "label": "host_cpu_used_rate" - } - ], "expressions": [ - "meter_instance_host_cpu_used_rate" + "meter_instance_golang_gc_heap_objects" ], "typesOfMQE": [ "TIME_SERIES_VALUES" @@ -1329,30 +1424,104 @@ }, { "x": 8, - "y": 26, + "y": 48, "w": 8, - "h": 13, - "i": "22", + "h": 12, + "i": "32", "type": "Widget", + "graph": { + "type": "Bar", + "showBackground": true + }, "widget": { - "title": "Host Memory Used Rate (%)" + "title": "Metadata Mcache (MB)" }, + "metricMode": "Expression", + "expressions": [ + "meter_instance_golang_metadata_mcache_labeled" + ], + "typesOfMQE": [ + "TIME_SERIES_VALUES" + ] + }, + { + "x": 0, + "y": 0, + "w": 8, + "h": 12, + "i": "33", + "type": "Widget", "graph": { "type": "Line", "step": false, "smooth": false, - "showSymbol": true, + "showSymbol": false, "showXAxis": true, "showYAxis": true }, - "metricMode": "Expression", "metricConfig": [ { - "label": "host_mem_used_rate" + "unit": "MB" } ], + "widget": { + "title": "Memory Heap Size (MB)" + }, + "metricMode": "Expression", + "expressions": [ + "meter_instance_golang_memory_heap_labeled/1024/1024" + ], + "typesOfMQE": [ + "TIME_SERIES_VALUES" + ] + }, + { + "x": 16, + "y": 36, + "w": 8, + "h": 12, + "i": "34", + "type": "Widget", + "graph": { + "type": "Line", + "step": false, + "smooth": false, + "showSymbol": false, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "title": "CGO Calls Per Minute" + }, + "metricMode": "Expression", + "expressions": [ + "meter_instance_golang_cgo_calls" + ], + "typesOfMQE": [ + "TIME_SERIES_VALUES" + ] + }, + { + "x": 16, + "y": 12, + "w": 8, + "h": 12, + "i": "35", + "type": "Widget", + "graph": { + "type": "Line", + "step": false, + "smooth": false, + "showSymbol": false, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "title": "GC Goal Size (MB)" + }, + "metricMode": "Expression", "expressions": [ - "meter_instance_host_mem_used_rate" + "meter_instance_golang_gc_heap_goal/1024/1024" ], "typesOfMQE": [ "TIME_SERIES_VALUES" From d8b8799c195c20239a786a4dd6de97ef18b2a378 Mon Sep 17 00:00:00 2001 From: mrproliu <741550557@qq.com> Date: Thu, 20 Jul 2023 21:35:59 +0800 Subject: [PATCH 2/2] Update docs/en/changes/changes.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 吴晟 Wu Sheng --- docs/en/changes/changes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md index 9b3108982277..98d9ebe4f677 100644 --- a/docs/en/changes/changes.md +++ b/docs/en/changes/changes.md @@ -50,7 +50,7 @@ * Apply MQE on Virtual-Cache layer UI-templates * Add Echo component ID(5015) language: Golang. * Fix `index out of bounds exception` in `aggregate_labels` MQE function. -* Update Golang instance tab under the general service dashboard UI template for adapt Go Agent metrics reporter. +* Add more Go VM metrics, as new skywalking-go agent provided since its 0.2 release. #### UI