From 64e702db7cab2e0b809ed2e068d279518f240962 Mon Sep 17 00:00:00 2001 From: Tetrergeru Date: Tue, 4 Jun 2024 13:45:14 +0200 Subject: [PATCH] fix average alias in consolidateBy function (#280) --- render/data/targets.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/render/data/targets.go b/render/data/targets.go index 0a7775cc..d4281b80 100644 --- a/render/data/targets.go +++ b/render/data/targets.go @@ -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] } }