Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query with usage of a variable not working after updating to 9.4.2 #64013

Closed
github-ps1304 opened this issue Mar 2, 2023 · 7 comments
Closed
Labels
needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc

Comments

@github-ps1304
Copy link

What happened:
upgraded Grafana to version 9.4.2 - queries with a variable (multiply a value with a variable to get €) are not working anymore. Error: "An error occurred within the plugin"
What you expected to happen:
multiply a value with a variable
How to reproduce it (as minimally and precisely as possible):
use value in query and multiply with a defined dashboard variable
Anything else we need to know?:

Environment:

  • Grafana version: 9.4.2
  • Data source type & version: InfluxDB 1.8.10
  • OS Grafana is installed on: Ubuntu 22.04 LTS
  • User OS & Browser: Mac OS Safarai
  • Grafana plugins:
  • Others: see info from Query Inspector:

Object request:Object url:"api/ds/query" method:"POST" data:Object queries:Array[6] range:Object from:"1677711600000" to:"1677797999999" hideFromInspector:false response:Object message:"An error occurred within the plugin" messageId:"plugin.downstreamError" statusCode:500 traceID:""

@github-ps1304 github-ps1304 changed the title Query with usage of a variable not woring after updating to 9.4.2 Query with usage of a variable not working after updating to 9.4.2 Mar 2, 2023
@mellieA
Copy link
Contributor

mellieA commented Mar 3, 2023

@github-ps1304 can you share steps to reproduce and a screenshot or example of how the query variable is defined and used in the query that produces this error?

@mellieA mellieA added the needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc label Mar 3, 2023
@github-ps1304
Copy link
Author

I do a simple query to aggregate values (integral) and multiply the result to get the € amount.

Query I am using
9 4 2-query

Variable 1 I am using
9 4 2-variable

Variable 2 I am using
9 4 2-variable-heute

@chrishoage
Copy link

chrishoage commented Mar 4, 2023

I am having the same issue.

My observations:

  • The variable containing a float fails
    • image
  • The variable containing an integer works
    • image
  • Avoiding the variable with the float works
    • image

Variable config

image

I have also tried removing the spaces after the commas, which did not help 0.35,0.35625,0.35375,0.365,0.38

@CatCookie
Copy link

I have the same issue after the upgrade.

My workaround for now is, that i define my variables as integer and divide them by a factor, so that i use integer values in my formulas only.

So instead of * ($__to -$__from) / 3600000 * $cost with $cost being 0.3456, i use * ($__to -$__from) / 3600000 * $cost/$factor in my query and define $cost as 3456 and $factor as 10000

It is just a lot of clicking to change it everywhere.

@github-ps1304
Copy link
Author

github-ps1304 commented Mar 15, 2023

I did a short test with 2 variables; VK = 425 div = 100000 - so my query is working again with the following:
SELECT integral("Verbrauch",1h)*$VK/$div FROM "AC" WHERE time>$Heute

so the issue is with constants < 1 for example 0.000425 as a variable - please troubleshoot and fix it.

@github-ps1304
Copy link
Author

just updated Grafana to V9.3.7 - for or me everything is working again !!!

@github-ps1304
Copy link
Author

fixed in version 9.3.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info Issue needs more information, like query results, dashboard or panel json, grafana version etc
Projects
None yet
Development

No branches or pull requests

4 participants