Support multi-value variables
bossm8 opened this issue · 1 comments
We got a use-case where we request REST Object ID's into a variable in the Grafana Dashboard. With this IDs would then like to create a visualisation panel (without panel repetition) which contains data from all the objects belonging to these IDs. However, the JSON API data source does not seem to implement this feature yet, we get the following as response (inspector):
{
"request": {
"url": "api/datasources/proxy/uid/a184a099-5d0c-4c14-8baa-e5fd02bc5d7b/projects/{33423,12749,15418,17930,20980,21755,33408,15777}",
"method": "GET",
"hideFromInspector": false
},
"response": {
"message": "404 Project Not Found"
}
}
Unfortunately we do not control the API and we cannot implement a filter or search query based on any parameter. It would be nice if there was an option supporting multi-value variables by e.g. requesting the given request path multiple times with each value and returning a complete list to Grafana. Eg. In the example above, instead of requesting <HOST>/projects/{33423,12749,15418,17930,20980,21755,33408,15777}
perform the following requests in the datasource and merge them into a json array:
<HOST>/projects/33423
<HOST>/projects/12749
<HOST>projects/15418
<HOST>projects/17930
- ...
Clearly this feature would not be working for all variables, for example if the variable is not an ID and would result in requesting different objects. So maybe this could be a query editor option of some kind?
Hiya.. we don't have plans to implement this feature due to operational complexity and performance reasons. Assume you have a variable with 100 values, meaning you need to make 100 HTTP calls to the server. Also if you have two or more variables in the URL path, imagine the number of HTTP calls it have to make.
alternatively, I would recommend to try Infinity where you can perform some basic pagination queries (but limited to 5 values).