InfluxGraph/influxgraph

influxgraph mixes target names and data

runejuhl opened this issue · 6 comments

As graphite-influxdb is deprecated we've tried switching to inlfuxgraph, but we hit an issue along the way.
When requesting multiple targets, influxgraph seems to confuse the target names and the data, so that the returned result has wrong names.

For instance, the following query returns wrong data when using influxgraph, but correct data when using graphite-influxdb:

curl 'https://graphite.internal/render' -H 'Host: graphite.internal' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: https://graphite.enableit.dk/grafana/' -H 'Content-Type: application/x-www-form-urlencoded' -H 'DNT: 1' -H 'Authorization: Basic cnVuZUBlbmFibGVpdC5kazoxNDgxMTkyMTg1ITdCbHNGdjFodFRWSGY5NDdzaE9sMEhFNmlOMG50a3FCVk0zQmg0U0taT3NlWHdtcU9hTE9TcFZhY1d4R2daaGM=' -H 'Connection: keep-alive' --data $'from=10%3A25_20161208&until=11%3A07_20161208&target=alias(c1mdewxeah.haproxy01.cpu.total.iowait%2C%20\'IO%20Wait\')&target=alias(c1mdewxeah.haproxy01.cpu.total.system%2C%20\'System\')&target=alias(c1mdewxeah.haproxy01.cpu.total.user%2C%20\'User\')&target=alias(c1mdewxeah.haproxy01.cpu.total.idle%2C%20\'Idle\')&format=json&maxDataPoints=316'

With influxgraph:

 [
  {"target": "IO Wait", "datapoints": [
    [186, 1481189100], [190, 1481189160], [190, 1481189220], [191, 1481189280], [191, 1481189340], [189, 1481189400], [191, 1481189460], [191, 1481189520], [190, 1481189580], [192, 1481189640], [190, 1481189700], [189, 1481189760], [190, 1481189820], [191, 1481189880], [190, 1481189940], [188, 1481190000], [191, 1481190060], [189, 1481190120], [188, 1481190180], [189, 1481190240], [177, 1481190300], [190, 1481190360], [190, 1481190420], [191, 1481190480], [192, 1481190540], [187, 1481190600], [189, 1481190660], [191, 1481190720], [190, 1481190780], [191, 1481190840], [190, 1481190900], [188, 1481190960], [190, 1481191020], [188, 1481191080], [189, 1481191140], [188, 1481191200], [189, 1481191260], [192, 1481191320], [190, 1481191380], [189, 1481191440], [186, 1481191500], [191, 1481191560], [191, 1481191620]]},
  {"target": "System", "datapoints": [
    [0, 1481189100], [0, 1481189160], [0, 1481189220], [0, 1481189280], [0, 1481189340], [0, 1481189400], [0, 1481189460], [0, 1481189520], [0, 1481189580], [0, 1481189640], [0, 1481189700], [0, 1481189760], [0, 1481189820], [0, 1481189880], [0, 1481189940], [0, 1481190000], [0, 1481190060], [0, 1481190120], [0, 1481190180], [0, 1481190240], [0, 1481190300], [0, 1481190360], [0, 1481190420], [0, 1481190480], [0, 1481190540], [0, 1481190600], [0, 1481190660], [0, 1481190720], [0, 1481190780], [0, 1481190840], [0, 1481190900], [0, 1481190960], [0, 1481191020], [0, 1481191080], [0, 1481191140], [0, 1481191200], [0, 1481191260], [0, 1481191320], [0, 1481191380], [0, 1481191440], [0, 1481191500], [0, 1481191560], [0, 1481191620]]},
  {"target": "User", "datapoints": [
    [2, 1481189100], [1, 1481189160], [1, 1481189220], [1, 1481189280], [1, 1481189340], [2, 1481189400], [1, 1481189460], [1, 1481189520], [1, 1481189580], [1, 1481189640], [2, 1481189700], [1, 1481189760], [1, 1481189820], [1, 1481189880], [1, 1481189940], [2, 1481190000], [1, 1481190060], [1, 1481190120], [1, 1481190180], [1, 1481190240], [3, 1481190300], [1, 1481190360], [1, 1481190420], [1, 1481190480], [1, 1481190540], [2, 1481190600], [1, 1481190660], [1, 1481190720], [1, 1481190780], [1, 1481190840], [2, 1481190900], [1, 1481190960], [1, 1481191020], [1, 1481191080], [1, 1481191140], [2, 1481191200], [1, 1481191260], [1, 1481191320], [1, 1481191380], [1, 1481191440], [2, 1481191500], [1, 1481191560], [1, 1481191620]]},
  {"target": "Idle", "datapoints": [
    [8, 1481189100], [6, 1481189160], [6, 1481189220], [4, 1481189280], [5, 1481189340], [6, 1481189400], [5, 1481189460], [5, 1481189520], [6, 1481189580], [5, 1481189640], [5, 1481189700], [6, 1481189760], [5, 1481189820], [5, 1481189880], [5, 1481189940], [6, 1481190000], [5, 1481190060], [6, 1481190120], [7, 1481190180], [7, 1481190240], [13, 1481190300], [6, 1481190360], [6, 1481190420], [5, 1481190480], [4, 1481190540], [7, 1481190600], [6, 1481190660], [5, 1481190720], [6, 1481190780], [5, 1481190840], [5, 1481190900], [6, 1481190960], [6, 1481191020], [7, 1481191080], [7, 1481191140], [7, 1481191200], [6, 1481191260], [5, 1481191320], [5, 1481191380], [7, 1481191440], [8, 1481191500], [5, 1481191560], [5, 1481191620]]}]

With graphite-influxdb:

[
  {"target": "IO Wait", "datapoints": [
    [0, 1481189100], [0, 1481189160], [0, 1481189220], [0, 1481189280], [0, 1481189340], [0, 1481189400], [0, 1481189460], [0, 1481189520], [0, 1481189580], [0, 1481189640], [0, 1481189700], [0, 1481189760], [0, 1481189820], [0, 1481189880], [0, 1481189940], [0, 1481190000], [0, 1481190060], [0, 1481190120], [0, 1481190180], [0, 1481190240], [0, 1481190300], [0, 1481190360], [0, 1481190420], [0, 1481190480], [0, 1481190540], [0, 1481190600], [0, 1481190660], [0, 1481190720], [0, 1481190780], [0, 1481190840], [0, 1481190900], [0, 1481190960], [0, 1481191020], [0, 1481191080], [0, 1481191140], [0, 1481191200], [0, 1481191260], [0, 1481191320], [0, 1481191380], [0, 1481191440], [0, 1481191500], [0, 1481191560], [null, 1481191620]]},
  {"target": "System", "datapoints": [
    [2, 1481189100], [1, 1481189160], [1, 1481189220], [1, 1481189280], [1, 1481189340], [2, 1481189400], [1, 1481189460], [1, 1481189520], [1, 1481189580], [1, 1481189640], [2, 1481189700], [1, 1481189760], [1, 1481189820], [1, 1481189880], [1, 1481189940], [2, 1481190000], [1, 1481190060], [1, 1481190120], [1, 1481190180], [1, 1481190240], [3, 1481190300], [1, 1481190360], [1, 1481190420], [1, 1481190480], [1, 1481190540], [2, 1481190600], [1, 1481190660], [1, 1481190720], [1, 1481190780], [1, 1481190840], [2, 1481190900], [1, 1481190960], [1, 1481191020], [1, 1481191080], [1, 1481191140], [2, 1481191200], [1, 1481191260], [1, 1481191320], [1, 1481191380], [1, 1481191440], [2, 1481191500], [1, 1481191560], [null, 1481191620]]},
  {"target": "User", "datapoints": [
    [8, 1481189100], [6, 1481189160], [6, 1481189220], [4, 1481189280], [5, 1481189340], [6, 1481189400], [5, 1481189460], [5, 1481189520], [6, 1481189580], [5, 1481189640], [5, 1481189700], [6, 1481189760], [5, 1481189820], [5, 1481189880], [5, 1481189940], [6, 1481190000], [5, 1481190060], [6, 1481190120], [7, 1481190180], [7, 1481190240], [13, 1481190300], [6, 1481190360], [6, 1481190420], [5, 1481190480], [4, 1481190540], [7, 1481190600], [6, 1481190660], [5, 1481190720], [6, 1481190780], [5, 1481190840], [5, 1481190900], [6, 1481190960], [6, 1481191020], [7, 1481191080], [7, 1481191140], [7, 1481191200], [6, 1481191260], [5, 1481191320], [5, 1481191380], [7, 1481191440], [8, 1481191500], [5, 1481191560], [null, 1481191620]]},
  {"target": "Idle", "datapoints": [
    [186, 1481189100], [190, 1481189160], [190, 1481189220], [191, 1481189280], [191, 1481189340], [189, 1481189400], [191, 1481189460], [191, 1481189520], [190, 1481189580], [192, 1481189640], [190, 1481189700], [189, 1481189760], [190, 1481189820], [191, 1481189880], [190, 1481189940], [188, 1481190000], [191, 1481190060], [189, 1481190120], [188, 1481190180], [189, 1481190240], [177, 1481190300], [190, 1481190360], [190, 1481190420], [191, 1481190480], [192, 1481190540], [187, 1481190600], [189, 1481190660], [191, 1481190720], [190, 1481190780], [191, 1481190840], [190, 1481190900], [188, 1481190960], [190, 1481191020], [188, 1481191080], [189, 1481191140], [188, 1481191200], [189, 1481191260], [192, 1481191320], [190, 1481191380], [189, 1481191440], [186, 1481191500], [191, 1481191560], [null, 1481191620]]}]

As you can see, the names and data are swapped. We've tried the current HEAD (317e2c3) and 1.0.0rc7 which both exhibit this behavior.

Hi,

Thanks for raising. I'm guessing you are not using template configuration as the old project did not support it, right?

1.0.0b1 might not exhibit this in that case as that is the version closest to the old project.

Will aim to get a fix in next RC.

Hi @pkittenis

Yes, we're not using template configuration. I just tried out 1.0.0b1, but that didn't change anything, the issue persists.

Ok, yes this an issue with multiple targets - #13 added support for that recently, previous versions did not support it at all, but seems to be an issue still with non-templated data.

Think this is good now, can you give this branch a go if you can please, to make sure the test case is correct.

Thank you for the quick patch @pkittenis; just tried it and it works great.

Have a nice weekend!

No worries, thanks for confirming.