go-graphite / carbonapi

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

[BUG] Tag object array result for GroupByTags #808

Open evdevk opened 8 months ago

evdevk commented 8 months ago

Related to https://github.com/go-graphite/carbonapi/issues/755

this bug is still around in latest 0.16.1 link

typical request without alias like: seriesByTag('name=system.system.load5', 'host=server1234') works ok. response tags array looks like:


tags:Object
    contur:"prod"
    host:"server1234"
    interval:"15s"
    ostype:"linux"

same request with groupbytags: groupByTags(seriesByTag('name=system.system.load5', 'host=server1234'), 'max', 'host')

have response array like this:

tags:Object
   host:"server1234"
   name:"max"

with older versions 0.15.5 works ok.

npazosmendez commented 8 months ago

groupByTags aggregates together multiple series that have the same values for a specific set of tags. Each of the series may have other tags too, but are discarded because not all series in a group may have the same values for those other tags.

The weird thing I see is how we name name:"max", that's not what Graphite Web does: https://github.com/graphite-project/graphite-web/blob/0ec7201c42ac2c14485c4c7eaab8a644082dc687/webapp/graphite/render/functions.py#L5801

evdevk commented 8 months ago

ok if it working as intended, as workaround I can add tags as argument in GroupByTags to get it as result

Civil commented 8 months ago

In this case "intended" = like in graphite-web

If current behavior mimics graphtie-web - that probably means if there will be a fix - it would be under its own feature flag, and I would work on that at low priority (taking into account amount of open issues and amount of free time I'm spending on the project now - likely never), but PRs that changes behavior under feature flag are welcome, I would gladly merge something like that if it doesn't change default behavior for people.