Skip to content

Commit

Permalink
fix average alias in consolidateBy function (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetrergeru authored Jun 4, 2024
1 parent 4a8766e commit 64e702d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions render/data/targets.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ func (tt *Targets) GetRequestedAggregation(target string) string {
ffName := filteringFunc.GetName()
ffArgs := filteringFunc.GetArguments()
if ffName == graphiteConsolidationFunction && len(ffArgs) > 0 {
// Graphite standard supports both average and avg.
// It is the only aggregation that has two aliases.
// https://graphite.readthedocs.io/en/latest/functions.html#graphite.render.functions.consolidateBy
if ffArgs[0] == "average" {
return "avg"
}
return ffArgs[0]
}
}
Expand Down

0 comments on commit 64e702d

Please sign in to comment.