This is an automated email from the ASF dual-hosted git repository.

dengliming pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 5a6f4e797d Optimize grafana dashboard and documentation (#530)
5a6f4e797d is described below

commit 5a6f4e797debafdc5835170c88651c687f26923d
Author: Kunshuai Zhu <[email protected]>
AuthorDate: Wed Apr 13 15:52:47 2022 +0800

    Optimize grafana dashboard and documentation (#530)
    
    * Optimize grafana dashboard and documentation
    
    * Optimize grafana dashboard and documentation
    
    * Add jvm_enabled prop in config of metrics plugin
---
 docs/plugin-center/observability/metrics-plugin.md |   9 +-
 .../plugin-center/observability/metrics-plugin.md  |  17 +-
 .../shenyu/monitor/request_metric_dashboard.json   | 229 ++++++---------------
 3 files changed, 72 insertions(+), 183 deletions(-)

diff --git a/docs/plugin-center/observability/metrics-plugin.md 
b/docs/plugin-center/observability/metrics-plugin.md
index 174387b2ff..6b3b35d1f3 100644
--- a/docs/plugin-center/observability/metrics-plugin.md
+++ b/docs/plugin-center/observability/metrics-plugin.md
@@ -35,12 +35,13 @@ description: Metrics plugin
 ```yml
 shenyu:
   metrics:
-    enabled: false  //false is close, true is open
+    enabled: false #false is close, true is open
     name : prometheus 
     host: 127.0.0.1
     port: 8090
     jmxConfig:
     props:
+      jvm_enabled: true #enable jvm monitoring
 ```
 
 ## Metrics Detail
@@ -161,15 +162,13 @@ Users need to install `Prometheus` service to collect
 
  ```yaml
  scrape_configs:
-   # The job name is added as a label `job=<job_name>` to any timeseries 
scraped from this config.
-   - job_name: 'prometheus'
+   - job_name: 'Apache ShenYu'
      # metrics_path defaults to '/metrics'
      # scheme defaults to 'http'.
      static_configs:
-     - targets: ['localhost:9190']
+     - targets: ['localhost:8090'] # metrics of apache shenyu are exposed on 
port 8090 by default
  ```
 
-
 * After the configuration is completed, you can directly double-click 
`prometheus.exe` in the window to start. The default boot port is `9090`, 
Success can be verified at http://localhost:9090/
 
 ## Panel Display
diff --git 
a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/observability/metrics-plugin.md
 
b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/observability/metrics-plugin.md
index 29d9b1a9b8..3ac530fc6c 100644
--- 
a/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/observability/metrics-plugin.md
+++ 
b/i18n/zh/docusaurus-plugin-content-docs/current/plugin-center/observability/metrics-plugin.md
@@ -37,13 +37,13 @@ description: Metrics插件
 ```yml
 shenyu:
   metrics:
-    enabled: false  // 设置为 ture 表示开启
+    enabled: false  #设置为 true 表示开启
     name : prometheus 
-    host: 127.0.0.1 //暴露的ip
-    port: 8090 //暴露的端口
-    jmxConfig: //jmx配置
+    host: 127.0.0.1 #暴露的ip
+    port: 8090 #暴露的端口
+    jmxConfig: #jmx配置
     props:
-      jvm_enabled: ture //开启jvm的监控指标
+      jvm_enabled: true #开启jvm的监控指标
 ```
 
 ## metrics信息
@@ -54,8 +54,6 @@ shenyu:
 
 | 名称                      | 类型                  |标签名称       | 说明               
   |
 |:------------------------ |:--------------------- 
|:-------------|:-------------------- |
-| Name                                 |type                   |labels         
| description                  |
-|:-----------------------------------  |:--------------------- |:------------- 
|:-------------------- |
 |shenyu_request_total                  |Counter                | none          
|collecting all requests of Apache ShenYu Gateway |
 |shenyu_request_throw_total            |Counter                | none          
|collecting all exception requests of Apache ShenYu Gateway |
 |shenyu_request_type_total             |Counter                | path,type     
|collecting all matched requests of monitor|
@@ -163,12 +161,11 @@ shenyu:
 
  ```yaml
  scrape_configs:
-   # The job name is added as a label `job=<job_name>` to any timeseries 
scraped from this config.
-   - job_name: 'prometheus'
+   - job_name: 'Apache ShenYu'
      # metrics_path defaults to '/metrics'
      # scheme defaults to 'http'.
      static_configs:
-     - targets: ['localhost:9190']
+     - targets: ['localhost:8090'] # metrics of apache shenyu are exposed on 
port 8090 by default
  ```
 
 **注:** `job_name`跟`monitor`插件配置的`metricsName`相对应
diff --git a/static/img/shenyu/monitor/request_metric_dashboard.json 
b/static/img/shenyu/monitor/request_metric_dashboard.json
index c6170d5508..cf5f854682 100755
--- a/static/img/shenyu/monitor/request_metric_dashboard.json
+++ b/static/img/shenyu/monitor/request_metric_dashboard.json
@@ -20,16 +20,15 @@
   },
   "description": "Complete dashboard using metrics from prometheus JMX 
exporter, with drill down per job > instance",
   "editable": true,
-  "fiscalYearStartMonth": 0,
   "gnetId": 8563,
   "graphTooltip": 0,
   "id": 4,
   "iteration": 1647961989756,
   "links": [],
-  "liveNow": false,
   "panels": [
     {
       "collapsed": false,
+      "datasource": null,
       "gridPos": {
         "h": 1,
         "w": 24,
@@ -42,10 +41,7 @@
       "type": "row"
     },
     {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "$datasource"
-      },
+      "datasource": "prometheus",
       "description": "Start time of the process since unix epoch in seconds.",
       "fieldConfig": {
         "defaults": {
@@ -107,10 +103,7 @@
       "pluginVersion": "8.3.3",
       "targets": [
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "gUakAaE7z"
-          },
+          "datasource": "prometheus",
           "exemplar": false,
           "expr": "time() - 
process_start_time_seconds{job=\"$job\",instance=\"$instance\"}",
           "format": "time_series",
@@ -125,10 +118,7 @@
       "type": "stat"
     },
     {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${datasource}"
-      },
+      "datasource": "prometheus",
       "description": "Api execute count.",
       "fieldConfig": {
         "defaults": {
@@ -173,12 +163,9 @@
       "pluginVersion": "8.3.3",
       "targets": [
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "gUakAaE7z"
-          },
+          "datasource": "prometheus",
           "exemplar": true,
-          "expr": 
"shenyu_execute_latency_millis_count{job=\"$job\",instance=\"$instance\"}",
+          "expr": 
"shenyu_request_type_total{job=\"$job\",instance=\"$instance\"}",
           "instant": false,
           "interval": "",
           "legendFormat": "{{path}}",
@@ -193,10 +180,7 @@
       "bars": false,
       "dashLength": 10,
       "dashes": false,
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${datasource}"
-      },
+      "datasource": "prometheus",
       "description": "collecting all requests of Apache ShenYu Gateway",
       "fill": 1,
       "fillGradient": 0,
@@ -237,10 +221,7 @@
       "steppedLine": false,
       "targets": [
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "gUakAaE7z"
-          },
+          "datasource": "prometheus",
           "exemplar": true,
           "expr": "shenyu_request_total{instance=\"$instance\",job=\"$job\"}",
           "interval": "",
@@ -248,10 +229,7 @@
           "refId": "A"
         },
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${datasource}"
-          },
+          "datasource": "prometheus",
           "exemplar": true,
           "expr": 
"shenyu_request_throw_total{instance=\"$instance\",job=\"$job\"}",
           "hide": false,
@@ -309,17 +287,14 @@
           "bars": false,
           "dashLength": 10,
           "dashes": false,
-          "datasource": {
-            "type": "prometheus",
-            "uid": "$datasource"
-          },
+          "datasource": "prometheus",
           "fill": 1,
           "fillGradient": 0,
           "gridPos": {
             "h": 9,
             "w": 12,
             "x": 0,
-            "y": 10
+            "y": 2
           },
           "hiddenSeries": false,
           "id": 8,
@@ -344,7 +319,7 @@
             "alertThreshold": true
           },
           "percentage": false,
-          "pluginVersion": "8.3.3",
+          "pluginVersion": "8.0.5",
           "pointradius": 5,
           "points": false,
           "renderer": "flot",
@@ -367,10 +342,7 @@
           "steppedLine": false,
           "targets": [
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "gUakAaE7z"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": 
"jvm_memory_bytes_used{area=\"$memarea\",job=\"$job\",instance=\"$instance\"}",
               "format": "time_series",
@@ -380,10 +352,7 @@
               "refId": "A"
             },
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "gUakAaE7z"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": " 
jvm_memory_bytes_max{area=\"$memarea\",job=\"$job\",instance=\"$instance\"}",
               "format": "time_series",
@@ -393,10 +362,7 @@
               "refId": "B"
             },
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "gUakAaE7z"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": 
"jvm_memory_bytes_used{area=\"$memarea\",job=\"$job\",instance=\"$instance\"} / 
jvm_memory_bytes_max >= 0",
               "format": "time_series",
@@ -446,17 +412,14 @@
           "bars": false,
           "dashLength": 10,
           "dashes": false,
-          "datasource": {
-            "type": "prometheus",
-            "uid": "$datasource"
-          },
+          "datasource": "prometheus",
           "fill": 1,
           "fillGradient": 0,
           "gridPos": {
             "h": 9,
             "w": 12,
             "x": 0,
-            "y": 19
+            "y": 11
           },
           "hiddenSeries": false,
           "id": 2,
@@ -494,10 +457,7 @@
           "steppedLine": false,
           "targets": [
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "gUakAaE7z"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": 
"jvm_memory_pool_bytes_max{pool=\"$mempool\",job=\"$job\",instance=\"$instance\"}",
               "format": "time_series",
@@ -509,10 +469,7 @@
               "step": 5
             },
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "gUakAaE7z"
-              },
+              "datasource": "prometheus",
               "expr": 
"jvm_memory_pool_bytes_used{pool=\"$mempool\",job=\"$job\",instance=\"$instance\"}",
               "format": "time_series",
               "interval": "",
@@ -588,10 +545,7 @@
           "bars": false,
           "dashLength": 10,
           "dashes": false,
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${datasource}"
-          },
+          "datasource": "prometheus",
           "description": "Bytes of a given JVM buffer pool.",
           "fill": 1,
           "fillGradient": 0,
@@ -599,7 +553,7 @@
             "h": 9,
             "w": 24,
             "x": 0,
-            "y": 12
+            "y": 39
           },
           "hiddenSeries": false,
           "id": 104,
@@ -623,7 +577,7 @@
             "alertThreshold": true
           },
           "percentage": false,
-          "pluginVersion": "8.3.3",
+          "pluginVersion": "8.0.5",
           "pointradius": 2,
           "points": false,
           "renderer": "flot",
@@ -633,10 +587,7 @@
           "steppedLine": false,
           "targets": [
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "gUakAaE7z"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": 
"jvm_buffer_pool_used_bytes{job=\"$job\",instance=\"$instance\"}",
               "instant": false,
@@ -684,6 +635,7 @@
     },
     {
       "collapsed": true,
+      "datasource": null,
       "gridPos": {
         "h": 1,
         "w": 24,
@@ -697,10 +649,7 @@
           "bars": false,
           "dashLength": 10,
           "dashes": false,
-          "datasource": {
-            "type": "prometheus",
-            "uid": "$datasource"
-          },
+          "datasource": "prometheus",
           "decimals": 0,
           "description": "Time spent in a given JVM garbage collector in 
seconds.",
           "fill": 1,
@@ -709,7 +658,7 @@
             "h": 8,
             "w": 12,
             "x": 0,
-            "y": 5
+            "y": 40
           },
           "hiddenSeries": false,
           "id": 5,
@@ -742,10 +691,7 @@
           "steppedLine": false,
           "targets": [
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "gUakAaE7z"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": 
"increase(jvm_gc_collection_seconds_sum{job=\"$job\",instance=~\"$instance\"}[$__interval])",
               "format": "time_series",
@@ -795,6 +741,7 @@
           "bars": false,
           "dashLength": 10,
           "dashes": false,
+          "datasource": null,
           "description": "Count of events that have been observed for the base 
metric (Time spent in a given JVM garbage collector in seconds.)",
           "fill": 1,
           "fillGradient": 0,
@@ -802,7 +749,7 @@
             "h": 8,
             "w": 12,
             "x": 12,
-            "y": 5
+            "y": 40
           },
           "hiddenSeries": false,
           "id": 96,
@@ -833,10 +780,7 @@
           "steppedLine": false,
           "targets": [
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "gUakAaE7z"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": 
"increase(jvm_gc_collection_seconds_count{job=\"$job\",instance=~\"$instance\"}[$__interval])",
               "interval": "60s",
@@ -884,6 +828,7 @@
     },
     {
       "collapsed": true,
+      "datasource": null,
       "gridPos": {
         "h": 1,
         "w": 24,
@@ -897,10 +842,7 @@
           "bars": false,
           "dashLength": 10,
           "dashes": false,
-          "datasource": {
-            "type": "prometheus",
-            "uid": "$datasource"
-          },
+          "datasource": "prometheus",
           "decimals": 0,
           "description": "Thread JVM.",
           "fill": 1,
@@ -909,7 +851,7 @@
             "h": 11,
             "w": 24,
             "x": 0,
-            "y": 6
+            "y": 13
           },
           "hiddenSeries": false,
           "id": 3,
@@ -944,10 +886,7 @@
           "steppedLine": false,
           "targets": [
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "gUakAaE7z"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": 
"jvm_threads_current{job=\"$job\",instance=\"$instance\"}",
               "format": "time_series",
@@ -959,10 +898,7 @@
               "step": 10
             },
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "gUakAaE7z"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": 
"jvm_threads_daemon{job=\"$job\",instance=\"$instance\"}",
               "format": "time_series",
@@ -974,10 +910,7 @@
               "step": 10
             },
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "gUakAaE7z"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": 
"jvm_threads_deadlocked{job=\"$job\",instance=\"$instance\"}",
               "format": "time_series",
@@ -987,10 +920,7 @@
               "refId": "C"
             },
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "$datasource"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": 
"jvm_threads_deadlocked_monitor{job=\"$job\",instance=\"$instance\"}",
               "hide": false,
@@ -1052,10 +982,7 @@
           "bars": false,
           "dashLength": 10,
           "dashes": false,
-          "datasource": {
-            "type": "prometheus",
-            "uid": "$datasource"
-          },
+          "datasource": "prometheus",
           "description": "The total number of classes that have been loaded or 
\n loaded since the JVM has started",
           "fill": 1,
           "fillGradient": 0,
@@ -1063,7 +990,7 @@
             "h": 9,
             "w": 24,
             "x": 0,
-            "y": 7
+            "y": 6
           },
           "hiddenSeries": false,
           "id": 4,
@@ -1085,7 +1012,7 @@
             "alertThreshold": true
           },
           "percentage": false,
-          "pluginVersion": "8.3.3",
+          "pluginVersion": "8.0.5",
           "pointradius": 5,
           "points": false,
           "renderer": "flot",
@@ -1095,10 +1022,7 @@
           "steppedLine": false,
           "targets": [
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "gUakAaE7z"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": "jvm_classes_loaded{job=\"$job\", 
instance=\"$instance\"}",
               "format": "time_series",
@@ -1110,10 +1034,7 @@
               "step": 10
             },
             {
-              "datasource": {
-                "type": "prometheus",
-                "uid": "$datasource"
-              },
+              "datasource": "prometheus",
               "exemplar": true,
               "expr": "jvm_classes_unloaded_total{job=\"$job\", 
instance=\"$instance\"}",
               "hide": false,
@@ -1162,8 +1083,8 @@
       "type": "row"
     }
   ],
-  "refresh": false,
-  "schemaVersion": 34,
+  "refresh": "10s",
+  "schemaVersion": 30,
   "style": "dark",
   "tags": [
     "JVM",
@@ -1175,26 +1096,8 @@
       {
         "current": {
           "selected": false,
-          "text": "Prometheus",
-          "value": "Prometheus"
-        },
-        "hide": 0,
-        "includeAll": false,
-        "multi": false,
-        "name": "datasource",
-        "options": [],
-        "query": "prometheus",
-        "queryValue": "",
-        "refresh": 1,
-        "regex": "",
-        "skipUrlSync": false,
-        "type": "datasource"
-      },
-      {
-        "current": {
-          "selected": false,
-          "text": "shenyu",
-          "value": "shenyu"
+          "text": "Apache ShenYu",
+          "value": "Apache ShenYu"
         },
         "hide": 0,
         "label": "job",
@@ -1202,29 +1105,22 @@
         "options": [
           {
             "selected": true,
-            "text": "shenyu",
-            "value": "shenyu"
+            "text": "Apache ShenYu",
+            "value": "Apache ShenYu"
           }
         ],
-        "query": "shenyu",
+        "query": "Apache ShenYu",
         "skipUrlSync": false,
         "type": "textbox"
       },
       {
         "allValue": ".*",
-        "current": {
-          "selected": false,
-          "text": "192.168.105.1:8081",
-          "value": "192.168.105.1:8081"
-        },
-        "datasource": {
-          "uid": "$datasource"
-        },
+        "datasource": "prometheus",
         "definition": "label_values(jvm_info{job=\"$job\"},instance)",
         "hide": 0,
         "includeAll": false,
         "label": "instance",
-        "multi": false,
+        "multi": true,
         "name": "instance",
         "options": [],
         "query": {
@@ -1246,9 +1142,7 @@
           "text": "All",
           "value": "$__all"
         },
-        "datasource": {
-          "uid": "$datasource"
-        },
+        "datasource": "prometheus",
         "definition": "",
         "hide": 2,
         "includeAll": true,
@@ -1274,10 +1168,10 @@
           "text": "All",
           "value": "$__all"
         },
-        "datasource": {
-          "uid": "$datasource"
-        },
-        "definition": "",
+        "datasource": "prometheus",
+        "definition": "label_values(jvm_memory_bytes_used{job=\"$job\", 
instance=\"$instance\"}, area)",
+        "description": null,
+        "error": null,
         "hide": 2,
         "includeAll": true,
         "multi": true,
@@ -1285,7 +1179,7 @@
         "options": [],
         "query": {
           "query": "label_values(jvm_memory_bytes_used{job=\"$job\", 
instance=\"$instance\"}, area)",
-          "refId": "Prometheus-memarea-Variable-Query"
+          "refId": "StandardVariableQuery"
         },
         "refresh": 1,
         "regex": "",
@@ -1322,9 +1216,8 @@
       "30d"
     ]
   },
-  "timezone": "",
-  "title": "shenyu dashboard",
-  "uid": "1XlU--P7k",
-  "version": 22,
-  "weekStart": ""
+  "timezone": "browser",
+  "title": "Apache ShenYu Dashboard",
+  "uid": "apache_shenyu_dashboard",
+  "version": 1
 }
\ No newline at end of file

Reply via email to