nodata不显示judgeItem tags (#90)
Co-authored-by: litianshun <litianshun@meicai.cn>
This commit is contained in:
parent
438ec4a0f3
commit
a3d956f780
|
@ -45,6 +45,7 @@ func nodataJudge() {
|
||||||
Endpoint: endpoint,
|
Endpoint: endpoint,
|
||||||
Metric: stra.Exprs[0].Metric,
|
Metric: stra.Exprs[0].Metric,
|
||||||
Tags: "",
|
Tags: "",
|
||||||
|
TagsMap: map[string]string{},
|
||||||
DsType: "GAUGE",
|
DsType: "GAUGE",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +57,8 @@ func nodataJudge() {
|
||||||
|
|
||||||
for _, data := range respData {
|
for _, data := range respData {
|
||||||
var metric, tag string
|
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 {
|
if len(arr) == 2 {
|
||||||
metric = arr[0]
|
metric = arr[0]
|
||||||
tag = arr[1]
|
tag = arr[1]
|
||||||
|
@ -71,6 +73,7 @@ func nodataJudge() {
|
||||||
Endpoint: data.Endpoint,
|
Endpoint: data.Endpoint,
|
||||||
Metric: metric,
|
Metric: metric,
|
||||||
Tags: tag,
|
Tags: tag,
|
||||||
|
TagsMap: dataobj.DictedTagstring(tag),
|
||||||
DsType: data.DsType,
|
DsType: data.DsType,
|
||||||
Step: data.Step,
|
Step: data.Step,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue