-
What Grafana version and what operating system are you using?
Grafana 7.5.12, Windows 10 -
What are you trying to achieve?
Increase performance by reducing number of expensive API calls, and instead reuse the returned JSON from the API in multiple panels / multiple series in same panel. -
How are you trying to achieve it?
I use the JSON API plugin for Grafana | Grafana Labs JSON API plugin, and also the instructions on how to share data between panels. -
What happened?
In the Transform tab when sharing a query from another panel, I did not find an option to query the JSON result using JSONPath or JSONata. -
What did you expect to happen?
I was hoping to be able to query the data using JSONata, as I i.e. need the ‘IN’ operator available in the query, and that seems to be difficult to accomplish using the currently supported transform options. -
Did you follow any online instructions? If so, what is the URL?
Share query results with another panel | Grafana documentation.
So in short, I can view the JSON returned by the shared query in Query inspector, and all I want is to query it using JSONata (alternatively JSONpath). But I cannot see how to do this, at and the moment I cannot see that the supported transforms meet the needs I have. In short, I have a stacked barchart populated by 4 timeseries retrieved from a custom REST Api (4 separate calls), and use a Grafana variable to turn on/off display of each of the time series. This works fine, but have a performance penalty, as the API calls can be quite expensive. So I’d like to replace the 4 API calls with a single call, and instead query the data in Grafana to make the 4 time series. The ‘filter by value’ transform takes me part of the way, but I also need to turn series on/off, and with JSONata I can do this by defining a field as:
$[0][priority in $priority].samples.fromtime
Where $priority is a Grafana variable with multiple values. But I cannot see how to define a transform to do this?
I am using the JSON API plugin. I see some previous post have pointed towards the Infinity plugin instead, but I was hoping to be able to do this kind of data sharing without having to change data source plugin, as it sounds like a fairly generic need.
Any hints or ideas on how this can be achieved? In advance, thanks!