0
votes

I have the following monitoring stack:

  • collecting data with telegraf-0.12
  • storing in influxdb-0.12
  • visualisation in grafana (3beta)

I am collecting "system" data from several hosts and I want to create a graph showing the "system.load1" of several host NOT merged. I though I could simply add multiple queries to the graph panel.

When creating my graph panel, I create the first serie and see the result but when I add the second query, I got an error.

Here is the panel creation with 2 queries

Here is the query generated by the panel:

SELECT mean("load1") FROM "system" WHERE "host" = 'xxx' AND time > now() - 24h GROUP BY time(1m) fill(null) SELECT mean("load1") FROM "system" WHERE "host" = 'yyy' AND time > now() - 24h GROUP BY time(1m) fill(null)

And the error:

{
  "error": "error parsing query: found SELECT, expected ; at line 2, char 1",
  "message": "error parsing query: found SELECT, expected ; at line 2, char 1"
}

So I can see that the generated query is malformed (2 select in one line without even a ';') but I don't know how to use Grafana to achieve what I want. When I show or hide each query individually I see the corresponding graph. I have created a similar graph (with multiple series) with chronograf but I would rather use grafana as I have many more control and plugins...

Is there something I am doing wrong here ?

2

2 Answers

3
votes

After reading couple of thread in github issues, here is a quick fix. As mentionned by @schup, the problem and its solution are described here: https://github.com/grafana/grafana/issues/4533

The binaries are currently not fixed in grafana-3beta (if might in the next weeks). So there are 2 options: fixing the source and compile or patched an existing install.

I actually had to patch my current install:

/usr/share/grafana/public/app/app.<number_might_differ_here>.js

sed --in-place=backup 's/join("\\n");return k=k.replace/join(";\\n");return k=k.replace/;s/.replace(\/%3B\/gi,";").replace/.replace/' app.<number_might_differ_here>.js

Hope this might help (and that it will soon be fixed)

0
votes

Seems to be an API change in influxdb 0.11 https://github.com/grafana/grafana/issues/4533