-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Text box template variable doesn't work properly without a default value #13666
Comments
Encouraged that it works for you, I re-ran the whole process from scratch with the same failure. Grafana app shows version as: v.5.3.0 (commit: c613a31), (and I'm pretty sure Textbox variable wasn't available in 5.2) FIX - And then I tested again after dumping my browser's entire cache. That fixed it. I'm not sure if that should be considered a bug? Assume there was some cached code that was not available in 5.2.3 that was needed by 5.3.0. Possibly need to detect version change and update cached data? My prod instance of Grafana is still 5.2.3 ATM. Could re-title this as - Must dump browser cache following update. Otherwise, this can be closed. |
I have the same problem. Browser cache clear doesn't help here. I had the case where in one Dash the variable was detected as a variable an in another dash not (in the same browser=Chromium). After updating to 5.3.1 the problem is in both dashboards, also in the one that worked before with 5.3 |
I found out, that this problem is present, if I have the default value of the text box empty (what we need) and then add the variable to the where clause of a metric. In the first place I get "No data" and the Query Inspector shows pathlevel1" =~ /$freetext/. Then when I type in the first text in the box and hit reload of the webpage then the filter is noticed as a variable and I get the data I expected. |
Later on I saved the dashboard again and now the variable also turned blue, where it wasn't before ?? So the point is: when I have text in the box and I press Reload page then the variable is recognized. When I empty the box and press Reload it turns white again in the metrics edit tab and I get "No data". |
@bolek2000 confirmed that text box template variable doesn't work properly when a default value is not provided. Thank you! Demo of behavior here |
This PR will resolve the on empty value issue (on empty is not the same as default): #13752, but it doesn't solve this specific bug, just adds additional capability. |
…lsy and not indexed by template srv #13666
Thanks @marefr - makes sense to fix the bugs first! I'll resync with master after. |
Hi I hit the same issue, was the fix implemented in one of the versions? |
Please include this information:
What Grafana version are you using? 5.3.0 via Docker
What datasource are you using? Elasticsearch
What OS are you running grafana on? CentOS 7.4
What did you do? Added new TextBox variable to Dashboard template, and include in metric query
What was the expected result? Variable value would be passed in the Lucene search (like other variables, example with constant attached)
What happened instead? The text of $variablename was passed instead
New Textbox variable is promising, but unable to get it to work - the variable name is passed in the metric query, as opposed to the value that is entered. Screenshots showing contant passed correctly, but textbox variable not passed:
The text was updated successfully, but these errors were encountered: