set alias blank if __alias__ not found

This commit is contained in:
UlricQin 2021-08-31 16:50:57 +08:00
parent 238a611cbb
commit bd84c433cd
1 changed files with 2 additions and 0 deletions

View File

@ -39,6 +39,8 @@ func Push(points []*vos.MetricPoint) error {
// 如果tags中发现有__ident__和__alias__就提到外层这个逻辑是为了应对snmp之类的场景
if val, has := points[i].TagsMap["__ident__"]; has {
points[i].Ident = val
// 如果后面没有发现__alias__那alias就给改成空
points[i].Alias = ""
delete(points[i].TagsMap, "__ident__")
}