From c5cefff4925121556f21a427401ce7dd44cd2b3e Mon Sep 17 00:00:00 2001 From: xiaojianjun Date: Mon, 24 Jan 2022 20:47:24 +0800 Subject: [PATCH 1/4] [Feature] Support collecting database connection pool metric,support MAL analyzer #8450 --- .../src/main/resources/application.yml | 2 +- .../meter-analyzer-config/datasource.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/datasource.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..8e015fccf21e 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:datasource} # 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/datasource.yaml b/oap-server/server-starter/src/main/resources/meter-analyzer-config/datasource.yaml new file mode 100644 index 000000000000..6dee2c443726 --- /dev/null +++ b/oap-server/server-starter/src/main/resources/meter-analyzer-config/datasource.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: datasource + exp: datasource.sum(['service', 'instance', 'name']) 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..5fcca8ad281b 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 @@ -495,6 +495,17 @@ templates: "queryMetricType": "readMetricsValues", "chartType": "ChartLine", "metricName": "instance_clr_available_completion_port_threads,instance_clr_available_worker_threads,instance_clr_max_completion_port_threads,instance_clr_max_worker_threads" + }, + { + "width": "3", + "title": "Database Connection Pool", + "height": "250", + "entityType": "ServiceInstance", + "independentSelector": false, + "metricType": "LABELED_VALUE", + "metricName": "meter_datasource", + "queryMetricType": "readLabeledMetricsValues", + "chartType": "ChartLine" } ] }, From 44d2121d8b6b2185619f2349373c6a85f6b90e0a Mon Sep 17 00:00:00 2001 From: xiaojianjun Date: Fri, 28 Jan 2022 15:04:38 +0800 Subject: [PATCH 2/4] modify backend-meter.md,datasource.yaml #8450 --- docs/en/setup/backend/backend-meter.md | 2 ++ .../src/main/resources/meter-analyzer-config/datasource.yaml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/en/setup/backend/backend-meter.md b/docs/en/setup/backend/backend-meter.md index 119b36059888..375dc4f759d2 100644 --- a/docs/en/setup/backend/backend-meter.md +++ b/docs/en/setup/backend/backend-meter.md @@ -66,12 +66,14 @@ 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 default can be found [here](../../../../oap-server/server-starter/src/main/resources/meter-analyzer-config/datasource.yaml). 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). | 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 | +|datasource| Metrics of DataSource metrics | meter-analyzer-config/datasource.yaml | Datasource --meter format--> SkyWalking OAP Server | ### Meters configuration diff --git a/oap-server/server-starter/src/main/resources/meter-analyzer-config/datasource.yaml b/oap-server/server-starter/src/main/resources/meter-analyzer-config/datasource.yaml index 6dee2c443726..411279a870f8 100644 --- a/oap-server/server-starter/src/main/resources/meter-analyzer-config/datasource.yaml +++ b/oap-server/server-starter/src/main/resources/meter-analyzer-config/datasource.yaml @@ -17,4 +17,4 @@ expSuffix: instance(['service'], ['instance'], Layer.GENERAL) metricPrefix: meter metricsRules: - name: datasource - exp: datasource.sum(['service', 'instance', 'name']) + exp: datasource.sum(['service', 'instance', 'name', 'status']) From 23a382f4284e64404fde4d4d4fb861cb78ef06b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=99=9F=20Wu=20Sheng?= Date: Fri, 28 Jan 2022 15:11:01 +0800 Subject: [PATCH 3/4] Update doc. --- docs/en/setup/backend/backend-meter.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/en/setup/backend/backend-meter.md b/docs/en/setup/backend/backend-meter.md index 375dc4f759d2..aa694691ed25 100644 --- a/docs/en/setup/backend/backend-meter.md +++ b/docs/en/setup/backend/backend-meter.md @@ -66,15 +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 default can be found [here](../../../../oap-server/server-starter/src/main/resources/meter-analyzer-config/datasource.yaml). -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 | +|spring-sleuth| Metrics of Spring Sleuth Application | meter-analyzer-config/spring-sleuth.yaml | Spring 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| |datasource| Metrics of DataSource metrics | meter-analyzer-config/datasource.yaml | Datasource --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 From e802c43290be2dcf87d6983332691fb7c012b598 Mon Sep 17 00:00:00 2001 From: xiaojianjun Date: Fri, 11 Feb 2022 11:45:22 +0800 Subject: [PATCH 4/4] update changes.md #8474 --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index d7c7539bf28d..2e09dea91757 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -51,15 +51,18 @@ Release Notes. * Set the default value of SW_STORAGE_IOTDB_SESSIONPOOL_SIZE to 8. * Bump up iotdb-session to 0.12.4. * Bump up PostgreSQL driver to fix CVE. +* Support datasource metric analysis. #### UI * Remove unused jars (log4j-api.jar) in classpath. * Bump up netty version to fix CVE. +* add Database Connection pool metric. #### Documentation * update backend-alarm.md doc, support op "=" to "==". +* update backend-meter.md doc . All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/112?closed=1)