I have created a workspace on Amazon Managed Grafana and the version is v9.4.7
For datasource, I am using JSON plugin from Šimon Podlipský. I have implemented backend with three endpoints as mentioned in the documentation.
Datasource is connecting successfully to API endpoint.
For dashboard, I am using Canvas panel. In the API response for the Metric selected I get the data from the API end point.
The data returned has list of values.
Below is a sample response for table.
[{"columns": [{"text": "Time", "type": "time"}, {"text": "Country", "type": "string"}, {"text": "Number", "type": "number"}],
"rows": [[1234567, "BE", 123], [1234567, "GE", 231], [1234567, "PS", 321]], "type": "table"}]
When I select Country as an option in Field, the value shown is PS which is the value in last list. Currently I am not able to figure out what has to be done to plot other
values like BE and GE.
I have tried with timeseries data format as well. But here also I am seeing that last value in the list is selected.
How can I get to plot the other values? Is there any issue with the format of the response (table/timeseries) generated?
Any inputs in this regard will be really helpful. Thank you.
Welcome,
Do you want it to look like this?
I would recommend you use infinity grafana plugin with UQL query & jsonata. See below for syntax on how it parses the sample data you posted.
https://try.jsonata.org/v187QSxr0
Thank you for the details. Yes basically I need these individual values to be selectable and plotted on a canvas panel. But in Amazon Managed Grafana, the only JSON plugin that is installed is JSON plugin. For all other plugins, there are no permissions to install.
Even Inifinity pluggin cannot be installed.
Currently I am not able to figure out how to parse JSON response for JSON plugin
Ouch. In that case you can still use jsonata. The example provided should work for you. Try it out and let us know if you are stuck
Hi,
Thank you for your inputs. I tried to use jsonata with Canvas Panel on Amazon Managed Grafana. But it throws an error saying unexpected token. There is a payload option which accepts only json
Then the other option is Transform next to Query as seen in the above diagram. There also I did not find any option which suits my requirement.
Can you guide me on how to use jsonata with Canvas panel?
using the other json plugin by Marcus Olsson
Thankyou. JSON plugin by Marcus Olsson is also not supported on Amazon Managed Grafana. I will have to look for other approaches.
so I created a simple nodejs rest api that returns the following
and it works with the json plugin you have
Thank you for the update. I checked with Bar Chart panel and in that case the output is same as what you have shown
But my requirement is to use Canvas Panel and then use different type of elements like metric-value where I can select the field to display the value corresponding to it.
The issue I am facing here is even though there is a list with 3 different set of values, only the last set of values is shown i.e [1234567, “PS”, 321]
1 Like