go-graphite / carbonapi

Implementation of graphite API (graphite-web) in golang
Other
309 stars 140 forks source link

Fix groupByNode/groupByNodes returning more series than expected #777

Closed carrieedwards closed 1 year ago

carrieedwards commented 1 year ago

The groupByNode and groupByNodes functions are in some cases not returning the expected number of series when compared with the same query being executed in Graphite-web. This is because in the Graphite-web implementation, Only the first result of the series that are returned from the callback function is used:

metaSeries[key] = SeriesFunctions[callback](requestContext, metaSeries[key])[0] metaSeries[key] = aggregate(requestContext, metaSeries[key], callback)[0]

In order to match Graphite-web's behavior, CarbonAPI's implementation should do the same.