0

I have a grafana dashboard. In this dashboard i created a variable. The sql query is wrong. My datasource is : ansdatabase

wrong query : select client from ansdatabase

Right query : select client from clienttable

Strange thing is. When i open variables page and write wrong query and save it. Below page shows preview of values. But there shouldnt be any values there. Also page throws an error that it couldnt find ansdatabase table. It is normal because ansdatabase is not a table name.

ivbtar
  • 799
  • 11
  • 29

1 Answers1

0

You must have done the right query before (select client from clienttable) correct? Grafana keeps the values from the last valid query.

  • I got this project from old developer. Current query written in variable page is wrong. But page is showing the value samples. It seems like variable page is keeping old successfull query in cache. And using it. But i dont see that query. I see wrong query in the page. – ivbtar Dec 02 '21 at 15:12
  • That's the way Grafana works. What would you like to do? Can you just fix the query? – Marcelo Ávila de Oliveira Dec 02 '21 at 18:05
  • 1
    But this is not a good behaivor for a product. Imagine i create a variable with a sql query. It works for 6 months. Then i change the query with a wrong query and save the variable without pressing update button. It saves the new changed wrong query but applies correcto query. And a new comer will never know correct query if the variable page is updated with wrong query. – ivbtar Dec 02 '21 at 19:14