do not cache ident alias mapper when ident is blank

This commit is contained in:
UlricQin 2021-06-28 18:17:14 +08:00
parent 4e6e70c14d
commit b03d57f40a
1 changed files with 4 additions and 3 deletions

View File

@ -52,9 +52,10 @@ func Push(points []*vos.MetricPoint) error {
logger.Warningf("point %+v is invalid, err:%v ", points[i], err)
reterr = err
} else {
// 把当前时间也带上处理的时候只处理最近的数据避免alias发生变化且数据分散在多个server造成的alias不一致的问题
aliasMapper[points[i].Ident] = &models.AliasTime{Alias: points[i].Alias, Time: now}
if points[i].Ident != "" {
// 把当前时间也带上处理的时候只处理最近的数据避免alias发生变化且数据分散在多个server造成的alias不一致的问题
aliasMapper[points[i].Ident] = &models.AliasTime{Alias: points[i].Alias, Time: now}
}
// 将resource的tag追加到曲线的tag中根据tagsmap生成tagslst排序生成primarykey
enrich(points[i])
validPoints = append(validPoints, points[i])