GoshPosh / grafana-meta-queries

Grafana plugin for calculating time period metrics like week over week, month over month and year over year etc.
Apache License 2.0
285 stars 71 forks source link

Cannot use arithmetic operation for more than 2 queries. #97

Open prokashyap opened 4 years ago

prokashyap commented 4 years ago

We have a graph in which we are plotting 3 values, cpu_user, cpu_system and cpu_waiting values. We wanted to add these 3 values to have a better understanding of cpu usage. The plugin is working fine when adding the values of any two metric mentioned above. We have the graph after adding 2 values. But, when I add the third query, and try to add that value in the arithmetic option, it's not working. Queries: A : SELECT "value" FROM "cpu_user" WHERE ("host" =~ /^$hostname$/) AND $timeFilter GROUP BY "host" B : SELECT "value" FROM "cpu_system" WHERE ("host" =~ /^$hostname$/) AND $timeFilter GROUP BY "host" C : SELECT "value" FROM "avg-cpu_pct_iowait" WHERE ("host" =~ /^$hostname$/) AND $timeFilter GROUP BY "host" D : This is for arithmetic operation, expression used is A['cpu_user']+B['cpu_system']+C['cpu_waiting'] There is not much about this online.

Gauravshah commented 4 years ago

can you add a screenshot ? also group by queries are not supported yet

prokashyap commented 4 years ago

Hi, Thanks for your response, group by will be needed. Here are the screen shots. I have selected cpu_load to show in the graph, for 2 queries values are coming, for 3 they are not. 2_queries 3_queries

Gauravshah commented 4 years ago

looks like casing issue "c" vs "C"

prokashyap commented 4 years ago

looks like casing issue "c" vs "C"

Using "C" only, this I modified for screenshot, so by mistake "c".

bfalese-navent commented 4 years ago

C is test, i think you should be using D