Grafana version: v3.1.1 (commit: a4d2708)
InfluxDB version: 1.0.2
Linux version (from uname -r): 4.4.51-40.58.amzn1.x86_64
I’m getting this error when attempting to run multiple InfluxDB queries.
“error”: “missing required parameter “q””,
“message”: “missing required parameter “q””
The first query (A) is defined as this:
SELECT non_negative_derivative(mean(bytes_recv),1s)*8 as "in" FROM "net" WHERE cloud_application_name =~ /$app/ AND interface =~ /(vlan|eth|bond).*/ AND $timeFilter GROUP BY time($interval), * fill(none)
The second query (B) is defined as this:
SELECT non_negative_derivative(mean(bytes_sent),1s)*8 as "out" FROM "net" WHERE cloud_application_name =~ /$app/ AND interface =~ /(vlan|eth|bond).*/ AND $timeFilter GROUP BY time($interval), * fill(none)
Both of these queries work fine and show data in the chart as long as they are the only queries defined (i.e., as query A, with no query B).
With both of these queries defined (as queries A and B), and with both of them enabled, I don’t see any errors. However, I only see data for the first query. If I disable the first query, I get the error (for query B). The problem appears to be related to the semicolon added to the beginning of the second query, which is encoded as %3B in the URL sent to Grafana. If I remove the semicolon in the URL, then the query seems to work (at least I see JSON-formatted output and no error).
Below is an example of the URL sent to Grafana with the first query (A) disabled (and with proprietary info substituted with generic text). Note the “%3B” encoded character before the SELECT statement.
https://<host where grafana is running>/grafana/api/datasources/proxy/1/query?db=telegraf&q=%3BSELECT%20non_negative_derivative(mean(bytes_sent)%2C1s)*8%20as%20%22out%22%20FROM%20%22net%22%20WHERE%20cloud_application_name%20%3D~%20%2F<service name>%2F%20AND%20interface%20%3D~%20%2F(vlan%7Ceth%7Cbond).*%2F%20AND%20time%20%3E%20now()%20-%206h%20GROUP%20BY%20time(5m)%2C%20*%20fill(none)&epoch=ms
The problems below sound similar in respect to parsing problems for multiple queries, but the exact errors are different.
Any ideas? Are we running with an unsupported Grafana/InfluxDB combo? Should I submit this as a new bug?