From a3d956f780dab5f15b75249623867f68ee65645d Mon Sep 17 00:00:00 2001 From: sven Date: Wed, 15 Apr 2020 21:03:20 +0800 Subject: [PATCH] =?UTF-8?q?nodata=E4=B8=8D=E6=98=BE=E7=A4=BAjudgeItem=20ta?= =?UTF-8?q?gs=20(#90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: litianshun --- src/modules/judge/judge/nodata.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/judge/judge/nodata.go b/src/modules/judge/judge/nodata.go index 0b2a3d2f..2e74e651 100644 --- a/src/modules/judge/judge/nodata.go +++ b/src/modules/judge/judge/nodata.go @@ -45,6 +45,7 @@ func nodataJudge() { Endpoint: endpoint, Metric: stra.Exprs[0].Metric, Tags: "", + TagsMap: map[string]string{}, DsType: "GAUGE", } @@ -56,7 +57,8 @@ func nodataJudge() { for _, data := range respData { var metric, tag string - arr := strings.Split(data.Counter, "/") + // 兼容格式disk.bytes.free/mount=/data/docker/overlay2/xxx/merged + arr := strings.SplitN(data.Counter, "/", 2) if len(arr) == 2 { metric = arr[0] tag = arr[1] @@ -71,6 +73,7 @@ func nodataJudge() { Endpoint: data.Endpoint, Metric: metric, Tags: tag, + TagsMap: dataobj.DictedTagstring(tag), DsType: data.DsType, Step: data.Step, }