0

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 Answers 2

3

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)

Sign up to request clarification or add additional context in comments.

1 Comment

Well done Jerome, you've saved my day! Still using v2.6 and your answer fixed the problem. Now I can use DERIVATIVE as well! SELECT DERIVATIVE(mean("bytes_recv"),1s) AS Rcvd FROM "net" WHERE "interface" = 'eth0' AND $timeFilter GROUP BY time($interval) fill(null); with a second query for the bytes_sent. Great work. Thank you.
0

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

1 Comment

You're right, I should have been more careful when searching answers for this... thx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.