go-graphite / go-carbon

Golang implementation of Graphite/Carbon server with classic architecture: Agent -> Cache -> Persister
MIT License
805 stars 123 forks source link

[BUG] [carbonserver] metrics find request have differents response based on enabled indexing mode #594

Closed Thorsieger closed 5 months ago

Thorsieger commented 5 months ago

Describe the bug When listing metrics from go-carbon with carbonserver (behind a carbonapi) the response is different based on which indexing method enabled.

Request : https://{$GRAPHITE_URL}/metrics/find/?query=carbon.aggregator.*

Go-carbon Configuration:

first case :

# [carbonserver]
# trie-index = false
# trigram-index = true

Response :
[{"allowChildren":1,"expandable":1,"leaf":0,"id":"graphite-aggregator-1","text":"graphite-aggregator-1","context":{}},{"allowChildren":1,"expandable":1,"leaf":0,"id":"graphite-aggregator-2","text":"graphite-aggregator-2","context":{}}]

second case :

# [carbonserver]
# trie-index = true
# trigram-index = false

Response :
[{"allowChildren":1,"expandable":1,"leaf":0,"id":"carbon.aggregator.graphite-aggregator-1","text":"graphite-aggregator-1","context":{}},{"allowChildren":1,"expandable":1,"leaf":0,"id":"carbon.aggregator.graphite-aggregator-2","text":"graphite-aggregator-2","context":{}}]

Note the different value of the "id" element. I find out that in graphite-web, it's by default the second response that I got.

I've tried to switch indexing mode to trie-index because of ram consumption problem (like https://github.com/go-graphite/go-carbon/issues/579). I will surely make an other issue about ram utilisation soon ( I'm currently running pprof analysis) or just add info in the previous issue.

deniszh commented 5 months ago

Hi @Thorsieger , We're using go-carbon together with carbonapi, but also using legacy UI (w/o database, just web part from https://github.com/lomik/graphite-web-ui) and for us it works fine. Do you experience any issues with different id value or it's just for nit-picking? If second one - we can accept PR but I would not prefer not fix that otherwise.

Thorsieger commented 5 months ago

Hello @deniszh

that does not break my UI (grafana integration) only my node auto-discovery for my zabbix monitoring system. I'd used "id" as a discovery macro and can just change to "text".

I'm also not sure it has to be fix, but can be usefull to be noted here (someone may find this issue and saw the difference)