Table panel + Simple JSON datasource, data in table-mode -> error

Hello, warming up with Grafana… anyway, something that I cannot resolve/understand. Help appreciated.

I’m wondering what Grafana’s Table panel expects as data (via) Simple JSON datasource.
Should SimpleJSONdatasource even work with “table-data”? I’m feeding this kind of JSON via SimpleJSONdatasource.

{“type”:“table”,“columns”:[{“text”:“Time”,“type”:“time”},{“text”:“String”,“type”:“string”},{“text”:“Number”,“type”:“number”}],“rows”:[[1503065409986,“face”,283.69652935336183],[1503065408986,“here”,3362.0711168181483],[1503065407986,“see”,5974.4767060272752],[1503065406986,“see”,4771.1572419661834],[1503065405986,“my”,780.028655110406],[1503065404986,“on”,4389.1377007594047],[1503065403986,“a”,4586.0111071495394],[1503065402986,“what”,2590.1913489667659],[1503065401986,“a”,270.04564881932254],[1503065400986,“in”,3288.4439013704864]]}

If I want to show this data in “Table” mode. I will get this error from Grafana:
TypeError: Cannot read property ‘type’ of undefined
at Object.transform (boot.js:29)
at f.c [as transformDataToTable] (boot.js:29)
at b.render (boot.js:30)
at a.render (boot.js:30)
at a.transformChanged (boot.js:30)
at fn (eval at compile (boot.js:54), :4:184)
at b.$eval (boot.js:52)
at boot.js:54
at Object. (boot.js:55)
at d (boot.js:50)

simple json data source only supports time series I think

Ok. Grafana itself has this Table panel and there is this JSON data as incoming data: http://docs.grafana.org/reference/table_panel/#json-data

Can someone shoot an example, what kind of JSON data it eats?

Thanks!

Ok, my bad. This sample nodejs project, had bug. Did not notice the open pull request…

Simple JSON data source works just fine, if you remember to feed right JSON to it :smiley:

Hello,
We got stuck with the SimpleJson with table panel. We are feeding the

{“columns”:[{“text”:“name”,“type”:“string”},{“text”:“classNmae”,“type”:“string”}],“rows”:[“raj”,“hettt”],“type”:“table”}

like this from our datasource. But while feeding the response from datasource to dashboard we are getting the below error.

Possibly unhandled rejection: {“err”:{“data”:null,“status”:-1,“config”:{“method”:“POST”,“transformRequest”:[null],“transformResponse”:[null],“jsonpCallbackParam”:“callback”,“url”:“http://localhost:8060”,“data”:{“target”:""},“headers”:{“Content-Type”:“application/json”,“Accept”:“application/json, text/plain, /”},“retry”:0},“statusText”:"",“xhrStatus”:“error”},“cancelled”:true}

Please help us whether to understand whether our json is correct.

Thanks.

Here is example of working table data JSON. Two columns “OWNER” and “TABLE_NAME”, 20 rows of data:

[{"type":"table","columns":[{"text":"OWNER","type":"string"},{"text":"TABLE_NAME","type":"string"}],"rows":[["LEAN","AFS_DEVICE"],["LEAN","AFS_DEVICE_EVENT"],["LEAN","AFS_DEVICE_ITEM"],["LEAN","AFS_MODULE"],["LEAN","AFS_NODE"],["LEAN","AFS_SERVICE"],["LEAN","AFS_SPAREPART"],["LEAN","AFS_DEVICE_DATA"],["LEAN","AFS_DEVICE_COMPANY"],["LEANHIS","AFS_DEVICE"],["LEANHIS","AFS_DEVICE_EVENT"],["LEANHIS","AFS_DEVICE_ITEM"],["LEANHIS","AFS_MODULE"],["LEANHIS","AFS_NODE"],["LEANHIS","AFS_SERVICE"],["LEANHIS","AFS_SPAREPART"],["LEANHIS","AFS_DEVICE_DATA"],["LEANHIS","AFS_DEVICE_COMPANY"],["LEAN","AFS_DEVICE_DATA_ENTRY"],["LEANHIS","AFS_DEVICE_DATA_ENTRY"]]}]

What would be passed in the target in request to get the data like this

[{“type”:“table”,“columns”:[{“text”:“OWNER”,“type”:“string”},{“text”:“TABLE_NAME”,“type”:“string”}],“rows”:[[“LEAN”,“AFS_DEVICE”],[“LEAN”,“AFS_DEVICE_EVENT”],[“LEAN”,“AFS_DEVICE_ITEM”],[“LEAN”,“AFS_MODULE”],[“LEAN”,“AFS_NODE”],[“LEAN”,“AFS_SERVICE”],[“LEAN”,“AFS_SPAREPART”],[“LEAN”,“AFS_DEVICE_DATA”],[“LEAN”,“AFS_DEVICE_COMPANY”],[“LEANHIS”,“AFS_DEVICE”],[“LEANHIS”,“AFS_DEVICE_EVENT”],[“LEANHIS”,“AFS_DEVICE_ITEM”],[“LEANHIS”,“AFS_MODULE”],[“LEANHIS”,“AFS_NODE”],[“LEANHIS”,“AFS_SERVICE”],[“LEANHIS”,“AFS_SPAREPART”],[“LEANHIS”,“AFS_DEVICE_DATA”],[“LEANHIS”,“AFS_DEVICE_COMPANY”],[“LEAN”,“AFS_DEVICE_DATA_ENTRY”],[“LEANHIS”,“AFS_DEVICE_DATA_ENTRY”]]}]

Please help me with this.

Study the Grafana HTTP/JSON requests and responses content with Browser F12 developer view. Use, grafana built in sample data source.

Any guidance on how to do this with so many controls?

https://play.grafana.org/d/000000012/grafana-play-home?orgId=1

Thanks!