-
Notifications
You must be signed in to change notification settings - Fork 65
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
Template variables doesn't work with the datasource in v8.1.0 #155
Comments
I just started using this data source with Grafana 8.1.2 and don't seem to have this problem. Maybe try updating from 8.1.0 to 8.1.2? |
Hmm, I'm not able to get it to happen with that JSON Model, but the bug still persist if params are used. JSON MODEL
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 27,
"iteration": 1630310729410,
"links": [],
"panels": [],
"schemaVersion": 30,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {
"selected": false,
"text": "Germany",
"value": "Germany"
},
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "country",
"options": [
{
"selected": true,
"text": "Germany",
"value": "Germany"
},
{
"selected": false,
"text": "United States",
"value": "United States"
}
],
"query": "Germany,United States",
"skipUrlSync": false,
"type": "custom"
},
{
"allValue": null,
"current": {
"selected": false,
"text": "Germany",
"value": "Germany"
},
"datasource": "Unis",
"definition": "$[0].country",
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "unis",
"options": [],
"query": {
"cacheDurationSeconds": 300,
"fields": [
{
"jsonPath": "$[0].country"
}
],
"method": "GET",
"params": [
[
"country",
"${country}"
]
],
"queryParams": "",
"urlPath": "/"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "JSON API not updating (bug)",
"uid": "-UInQt4nk",
"version": 8
} Datasource name: Unis |
Hm. This reminds me of #95, which has been eluding me so far, unfortunately. |
That bug doesn't seem to be this problem. This seems to only happen when params with variables are used. Fields with variables seem to work. |
Having a similar issue with params with variables. We use a text box instead of a dropdown. Hitting "enter" just refreshes the page and clears the text box. However, if we hit "tab", it correctly triggers and our table updates. |
Unfortunately, I got the same problem here with Grafana v8.3.3. |
I have the same problem. When I select a variable in a dropdown the database query does not execute with the new variable. No http call in the debugger. I found a strange fix by coincidence. I tried to create a workaround with getting all values from the web api and filter it with the transformation "filter data by value" using the variable in my table. And now it works! What works is not the transformation itself, it's the trigger from the transformation that starts a new query for the database. I found out that the transformation "filter data by value" cannot handle variables at all but it will trigger a query refresh. Even if I disable the transformation it works. Hope this can help to find the bug. |
Thank you all for confirming and providing details! I'll prioritize this. |
After moving from Grafana v8.0.6 to v8.1.0 the template variables stops working.
A full page refresh is needed to update the template variables.
This also happens to panel queries.
v8.1.0 (bug)
v8.0.6
I wasn't able to get this bug to happen to the influx datasource, but this might be more of a Grafana issue.
JSON MODEL
Datasource name: GRAFANA API
Datasrouce url: https://grafana.com/api/plugins
The text was updated successfully, but these errors were encountered: