Grafana Datasource Plugin - Table response JSON

I was exploring developing a datasource plugin. I understood from the document that, datasource.query function can return 2 different kinds of response JSON:

  1. Timeseries
  2. Table

My question is assuming my user has selected Table as the JSON response format, then the only visual component they can use to view the result is Table panel. If they select any other visual panels the result data wont be rendered at all as most of the other visual components will be able to render Timeseries response JSON only.

My question is, in the Add Panel functionality, when user clicks the Add Query option, we ask the user to choose the Format of the result. Next when the user wants to “Choose the Visualization”, currently Grafana shows all visual components. Considering the user has already selected Table as the result format, is there a way to limit the components being displayed in the “Choose the Visualization” screen to show only Table component as other components wont understand the Table response JSON.

Is there a way to achieve that? Otherwise we need to educate the user to choose only Table component if they have selected the format as Table , which is very confusing to the beginner user who designs their dashboard for the first time. It would be ideal to show the visual components which are applicable for the format of the result.

is there any solution or can Grafana consider this enhancement as it will help most of the plugin developers?

Thanks for any feedback.


1 Like

I noticed that Grafana 7 now handles it nicely with a message on the Graph , “Unable to graph data …Switch to table view” …nice touch, this is what I was looking for. Thanks Grafana team!