Преглед на файлове

[manager,collector]feature:api monitor support query params (#59)

tomsun28 преди 3 години
родител
ревизия
6a9d65ba5d

+ 1 - 1
collector/src/main/java/com/usthe/collector/dispatch/timer/WheelTimerTask.java

@@ -90,7 +90,7 @@ public class WheelTimerTask implements TimerTask {
                 if (key != null && key.startsWith("^_^") && key.endsWith("^_^")) {
                     key = key.replaceAll("\\^_\\^", "");
                     Configmap param = configmap.get(key);
-                    if (param.getType() == (byte) 3) {
+                    if (param != null && param.getType() == (byte) 3) {
                         String jsonValue = (String) param.getValue();
                          Map<String, String> map = GsonUtil.fromJson(jsonValue, Map.class);
                          if (map != null) {

+ 5 - 0
manager/src/main/resources/define/app/api.yml

@@ -28,6 +28,8 @@ configmap:
     type: 1
   - key: headers
     type: 3
+  - key: params
+    type: 3
 # 指标组列表
 metrics:
   # 第一个监控指标组 cpu
@@ -61,6 +63,9 @@ metrics:
       headers:
         content-type: ^_^contentType^_^
         ^_^headers^_^: ^_^headers^_^
+      # 请求参数内容
+      params:
+        ^_^params^_^: ^_^params^_^
       # 认证
       authorization:
         # 认证方式: Basic Auth, Digest Auth, Bearer Token

+ 6 - 0
manager/src/main/resources/define/param/api.yml

@@ -49,6 +49,12 @@ param:
     required: false
     keyAlias: Header Name
     valueAlias: Header Value
+  - field: params
+    name: 查询Params
+    type: key-value
+    required: false
+    keyAlias: Param Key
+    valueAlias: Param Value
   - field: contentType
     name: Content-Type
     type: text