simPod / GrafanaJsonDatasource

Grafana datasource to load JSON data over your arbitrary HTTP backend
https://grafana.com/grafana/plugins/simpod-json-datasource/
MIT License
355 stars 72 forks source link

Help with json and singlestat #30

Closed vovanb closed 5 years ago

vovanb commented 5 years ago

Hi I am new to graphana... I have installed (https://github.com/bergquist/fake-simple-json-datasource) fake datasource. I want to create simple dashboard using table from fake example: [{"columns":[{"text":"Time","type":"time"},{"text":"Country","type":"string"},{"text":"Number","type":"number"}],"values":[[1553027298855,"SE",123],[1553026298855,"DE",231],[1553025298855,"US",321]]}] I want to create singlestat panel http://docs.grafana.org/features/panels/singlestat/ using data from above table for example show Country = DE, so panel will show Number - 231.

In addition when I select table I got "Cannot read property 'length' of undefined" error .. Will appreciate for help - may be possible to run short session

simPod commented 5 years ago

Hi @vovanb, I'm not sure how that is compatible with this datasource. Does table panel work ok?

I'm not sure about the format for singlestat. Maybe try to put it out of the array so you pass only the object there. If that doesn't work, you'll have to debug manually the proper response format. If you post your results here, that would be certainly helpful for others.

vovanb commented 5 years ago

Hi Simon As I said I am new to graphana... and will be difficult to give you answers. Table panel works o pt for time series. How to debug graphana or json data source? Can we run short screen sharing session?

On 20 Mar 2019, at 22:39, Šimon Podlipský notifications@github.com wrote:

Hi @vovanb, I'm not sure how that is compatible with this datasource. Does table panel work ok?

I'm not sure about the format for singlestat. Maybe try to put it out of the array so you pass only the object there. If that doesn't work, you'll have to debug manually the proper response format. If you post your results here, that would be certainly helpful for others.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

simPod commented 5 years ago

@vovanb hello again. Just checkout this repository, run yarn install and yarn run watch and put some console.log statements so you can see what's happening there.

vovanb commented 5 years ago

Ok will do - but how graphana will use plugin from my server and not one that is deployed to cloud?

On 22 Mar 2019, at 15:00, Šimon Podlipský notifications@github.com wrote:

@vovanb hello again. Just checkout this repository, run yarn install and yarn run watch and put some console.log statements so you can see what's happening there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

simPod commented 5 years ago

What I do is to in plugins directory (/var/lib/grafana/plugins/<this datasource folder> usually) run git init git remote add origin <url> git reset --hard origin/<branch>. (There may be better ways but I use this one)

then yarn install yarn run watch

ask if needed!

simPod commented 5 years ago

@vovanb hi, have you resolved it?

vovanb commented 5 years ago

Nope

Sincerely, Vladimir (Sent from my mobile)

On 26 May 2019, at 13:14, Šimon Podlipský notifications@github.com wrote:

@vovanb hi, have you resolved it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

simPod commented 5 years ago

And are you planning to look into it?