When the alert can support simple json datasource?

I’d like to know when the alert could support simple json data source ?

The Grafana team has no plans for this in the near future.

Hi @daniellee i see in your roadmap that u are working on offering backend support for custom datasources. Do u still intend to offer this feature? and would the simple json datasource not fall under that?

We won’t be working more on backend plugin support until next year. But yes, there is already an alpha implementation if you want to test it or implement it yourself: https://github.com/grafana/simple-json-datasource/tree/backend-updated but we will not be officially supporting that in the next 6 months at least.

@daniellee Thanks for the update i have already worked on that branch, and was able to get alerts and notifications working, however there only seems to be support for Linux and Darwin i.e the binaries included in the dist folder. Is there a way to get this working on Windows?

@leemm I will create the Windows binary this week for the Simple Json datasource and update the branch.

@leemm I added the Windows binary to the backend-updated branch. Can you test if that works for you?

I tested it on Windows with this fake backend. If you turn on debug mode in Grafana (set log level to debug in the ini file), then you should see a message like this in the logs:

DBUG[10-15|21:46:30] 2018-10-15T21:46:30.518+0200 [DEBUG] simple-json-datasource: Query: datasource=SimpleJson TimeRange="fromRaw:"1539611190472" toRaw:"1539632790472" fromEpochMs:1539611190472 toEpochMs:1539632790472 " logger=plugins plugin-id=grafana-simple-json-datasource

And here is alerting working with the Simple Json datasource on Windows:

To build the Windows binary, I just ran the following command on Windows from the root directory for the plugin:

go build -o ./dist/simple-plugin_windows_amd64.exe .

@daniellee Hi that is great i will give it a go and let you know how i get on. Thanks for the help with this.

Thanks Daniellee,

Its working for me. HOw can we run it in Linux environment

Regards
Sreejit

Hi Danielle,
I’m not really familiar with go. I want to use simple-json plugin for alerting in windows. Can you please explain how to build the windows binary and how to use it for a beginner like me. Thanks in advance.

Hi daniellee … I tried the following steps and successfully build simplejson datasource.But when I am trying to integrate my api endpoint in the datasource I am getting error saying “Cannot read property ‘from’ of undefined”.

Hi @sreejit2410 … can you please help me out in setting it up ?

Can you provide the full stacktrace for the error? Really hard to say what the problem is without more details.

Can you also provide a sample of the json data that you are returning from your api endpoint - is it in the correct format (time series or table format)?

Hi @daniellee, Thanks for the response.I am describing the issues with screenshots.Please refer for the same.

Issue_1:After cloning from backend-updated branch, I am running “go build -o ./dist/simple-plugin_windows_amd64.exe .” from root.so I am getting error in command prompt saying, “module declares it’s path as: github.com/grafana/grafana-plugin-model
but required as: github.com/grafana/grafana_plugin_model”.

As I changed the path as “github.com/grafana/grafana-plugin-model” in ‘datasource.go’ and ‘plugins.go’ file, I ran the same command and the command executed with no output.I am able to get simplejson datasource option in the grafana UI.But while I am trying to integrate my backend api with the datasource it sows error in redline mentioning “cannot read property ‘from’ of undefined”.

If I directly install simplejson datasource from the official documentation using grafana-cli I am able to integrate my api and able to visualize trends without any issues.My backend api has 3 end points; ‘/’, ‘/search’ and ‘/query’ and it is in timeseries format only and works fine if I install simplejson plugin using grafana-cli.