From aec3cd04480f9dbfe04d0ba3c217de59b92913c5 Mon Sep 17 00:00:00 2001 From: litexu Date: Thu, 20 Jan 2022 23:14:55 +0800 Subject: [PATCH 1/4] init --- .../src/main/resources/application.yml | 2 +- .../meter-analyzer-config/threadpool.yaml | 20 +++++++++++++++++++ .../ui-initialized-templates/apm.yml | 11 ++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 oap-server/server-starter/src/main/resources/meter-analyzer-config/threadpool.yaml diff --git a/oap-server/server-starter/src/main/resources/application.yml b/oap-server/server-starter/src/main/resources/application.yml index b9a99c08910f..1a6e50e94507 100755 --- a/oap-server/server-starter/src/main/resources/application.yml +++ b/oap-server/server-starter/src/main/resources/application.yml @@ -262,7 +262,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:} # Which files could be meter analyzed, files split by "," + meterAnalyzerActiveFiles: ${SW_METER_ANALYZER_ACTIVE_FILES:threadpool} # Which files could be meter analyzed, files split by "," log-analyzer: selector: ${SW_LOG_ANALYZER:default} diff --git a/oap-server/server-starter/src/main/resources/meter-analyzer-config/threadpool.yaml b/oap-server/server-starter/src/main/resources/meter-analyzer-config/threadpool.yaml new file mode 100644 index 000000000000..861c48817717 --- /dev/null +++ b/oap-server/server-starter/src/main/resources/meter-analyzer-config/threadpool.yaml @@ -0,0 +1,20 @@ +# 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: thread_pool + exp: thread_pool.avg(['metric_type', 'pool_name', 'instance', 'service']) \ No newline at end of file diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/apm.yml b/oap-server/server-starter/src/main/resources/ui-initialized-templates/apm.yml index 98be7f1f214a..1dd50a2bdf41 100644 --- a/oap-server/server-starter/src/main/resources/ui-initialized-templates/apm.yml +++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/apm.yml @@ -448,6 +448,17 @@ templates: "queryMetricType": "readMetricsValues", "chartType": "ChartArea" }, + { + "width": 3, + "title": "Thread Pool(Java Service)", + "height": "250", + "entityType": "ServiceInstance", + "independentSelector": false, + "metricType": "LABELED_VALUE", + "metricName": "meter_thread_pool", + "queryMetricType": "readLabeledMetricsValues", + "chartType": "ChartLine" + }, { "width": 3, "title": "CLR CPU (.NET Service)", From 006f965183b09e213ac1fc2750266912af3cc6a9 Mon Sep 17 00:00:00 2001 From: litexu Date: Thu, 20 Jan 2022 23:22:44 +0800 Subject: [PATCH 2/4] change log --- CHANGES.md | 1 + oap-server/server-starter/src/main/resources/application.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index e4db0124e91d..70f5fb858025 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -34,6 +34,7 @@ Release Notes. * Support ZGC GC time and count metric collecting. * Sync proto buffers files from upstream Envoy (Related to https://github.com/envoyproxy/envoy/pull/18955). * Bump up GraphQL related dependencies to latest versions. +* Support Java thread pool metric collect. #### UI diff --git a/oap-server/server-starter/src/main/resources/application.yml b/oap-server/server-starter/src/main/resources/application.yml index 1a6e50e94507..b9a99c08910f 100755 --- a/oap-server/server-starter/src/main/resources/application.yml +++ b/oap-server/server-starter/src/main/resources/application.yml @@ -262,7 +262,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:threadpool} # Which files could be meter analyzed, files split by "," + meterAnalyzerActiveFiles: ${SW_METER_ANALYZER_ACTIVE_FILES:} # Which files could be meter analyzed, files split by "," log-analyzer: selector: ${SW_LOG_ANALYZER:default} From 6c65e687fcb07c23926a4ded304be6de6147b706 Mon Sep 17 00:00:00 2001 From: litexu Date: Sat, 29 Jan 2022 02:11:22 +0800 Subject: [PATCH 3/4] add doc --- docs/en/setup/backend/backend-meter.md | 3 ++- oap-server/server-starter/src/main/resources/application.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/en/setup/backend/backend-meter.md b/docs/en/setup/backend/backend-meter.md index 119b36059888..20189abed7b2 100644 --- a/docs/en/setup/backend/backend-meter.md +++ b/docs/en/setup/backend/backend-meter.md @@ -51,7 +51,7 @@ Note: `$name` is the original metric name. ## Configuration file The meter receiver is configured via a configuration file. The configuration file defines everything related to receiving from agents, as well as which rule files to load. - + The OAP can load the configuration at bootstrap. If the new configuration is not well-formed, the OAP may fail to start up. The files are located at `$CLASSPATH/meter-analyzer-config`. @@ -72,6 +72,7 @@ If you're using Spring Sleuth, see [Spring Sleuth Setup](spring-sleuth-setup.md) | Rule Name | Description | Configuration File | Data Source | |-----|-----|-----|-----| |spring-sleuth| Metrics of Spring Sleuth Application | meter-analyzer-config/spring-sleuth.yaml | Sprign Sleuth Application --meter format--> SkyWalking OAP Server | +|threadpool| Metrics of Thread Pool | meter-analyzer-config/threadpool.yaml | Thread Pool --meter format--> SkyWalking OAP Server | ### Meters configuration diff --git a/oap-server/server-starter/src/main/resources/application.yml b/oap-server/server-starter/src/main/resources/application.yml index b9a99c08910f..1a6e50e94507 100755 --- a/oap-server/server-starter/src/main/resources/application.yml +++ b/oap-server/server-starter/src/main/resources/application.yml @@ -262,7 +262,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:} # Which files could be meter analyzed, files split by "," + meterAnalyzerActiveFiles: ${SW_METER_ANALYZER_ACTIVE_FILES:threadpool} # Which files could be meter analyzed, files split by "," log-analyzer: selector: ${SW_LOG_ANALYZER:default} From 9b14f020cc166d7fc5f55ab337a0232b99151dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=99=9F=20Wu=20Sheng?= Date: Sat, 29 Jan 2022 08:37:55 +0800 Subject: [PATCH 4/4] Update backend-meter.md --- docs/en/setup/backend/backend-meter.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/en/setup/backend/backend-meter.md b/docs/en/setup/backend/backend-meter.md index 20189abed7b2..e285002a1eb8 100644 --- a/docs/en/setup/backend/backend-meter.md +++ b/docs/en/setup/backend/backend-meter.md @@ -66,14 +66,17 @@ New meter-analyzer-config files is **NOT** enabled by default, you should make m Meter-analyzer-config file is written in YAML format, defined by the scheme described below. Brackets indicate that a parameter is optional. -An example can be found [here](../../../../oap-server/server-starter/src/main/resources/meter-analyzer-config/spring-sleuth.yaml). -If you're using Spring Sleuth, see [Spring Sleuth Setup](spring-sleuth-setup.md). +All available meter analysis scripts could be found [here](../../../../oap-server/server-starter/src/main/resources/meter-analyzer-config/). | Rule Name | Description | Configuration File | Data Source | |-----|-----|-----|-----| |spring-sleuth| Metrics of Spring Sleuth Application | meter-analyzer-config/spring-sleuth.yaml | Sprign Sleuth Application --meter format--> SkyWalking OAP Server | +|satellite| Metrics of SkyWalking Satellite self-observability(so11y)| meter-analyzer-config/satellite.yaml| SkyWalking Satellite --meter format-->SkyWalking OAP Server| |threadpool| Metrics of Thread Pool | meter-analyzer-config/threadpool.yaml | Thread Pool --meter format--> SkyWalking OAP Server | +An example can be found [here](../../../../oap-server/server-starter/src/main/resources/meter-analyzer-config/spring-sleuth.yaml). +If you're using Spring Sleuth, see [Spring Sleuth Setup](spring-sleuth-setup.md). + ### Meters configuration ```yaml