Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
Alias functions should set the name tag
Browse files Browse the repository at this point in the history
  • Loading branch information
shanson7 committed Dec 6, 2018
1 parent f1dfbde commit eeef4d4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions expr/func_alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func (s *FuncAlias) Exec(cache map[Req][]models.Series) ([]models.Series, error)
for i := range series {
series[i].Target = s.alias
series[i].QueryPatt = s.alias
series[i].Tags["name"] = s.alias
}
return series, nil
}
1 change: 1 addition & 0 deletions expr/func_aliasbynode.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func (s *FuncAliasByNode) Exec(cache map[Req][]models.Series) ([]models.Series,
n := aggKey(serie, s.nodes)
series[i].Target = n
series[i].QueryPatt = n
series[i].Tags["name"] = n
}
return series, nil
}
1 change: 1 addition & 0 deletions expr/func_aliassub.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func (s *FuncAliasSub) Exec(cache map[Req][]models.Series) ([]models.Series, err
name := s.search.ReplaceAllString(metric, replace)
series[i].Target = name
series[i].QueryPatt = name
series[i].Tags["name"] = name
}
return series, err
}

0 comments on commit eeef4d4

Please sign in to comment.