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

This commit is contained in:
tomsun28
2022-04-04 08:40:23 +08:00
committed by GitHub
parent 3c48b4c71f
commit 6a9d65ba5d
3 changed files with 12 additions and 1 deletions

View File

@@ -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) {

View File

@@ -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

View File

@@ -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