DataYours / Graphite / Vera / Grafana

Hi,
I have setup DataYours, it works very well.
I do store the graphite db file on a Synology NAS.
I am trying to connect Grafana (http://grafana.org) to “DataYours - Graphite” running on the Vera.
Within Grafana, there is an option to set a “Data Source” up with Graphite. A url seems to be required like “http://ip-address:port”.

I have tried various things without any luck like “http://vera-ip-address:2003” or “http://vera-ip-address:3480” …

I would appreciate any help.

Thanks

I’m not familiar with Grafana, but very keen to see third-party tools linked to [tt]DataYours[/tt] (since GUIs are really a pain to develop, it’s always a good plan to use something good someone else has crafted.)

I’ll try to take a look and see what’s required. It may take an extra tweak of the code (or, I suppose, it might be a bit more than that) but let’s find out.

Excellent, thank you.
I am looking forwarding testing it.
GL

OK, well at first sight it looks like it should be:

vera-ip-address:3480/data_request?id=lr_

…since the usual Graphite URL requests starts with “dashboard” “render” which it ought to append to the above. It’s possible that it won’t like this syntax. See if it gets you any further.

One thing I’m not sure of is what protocol it uses for directory browsing… it’s apparent not in the extensive URL API documentation - I may have to delve into their source code.


[Edit: corrected “render” URL above]

Please see attachment …

Here is what I get with “vera-ip-address:3480/data_request?id=lr_”

No graph - error saying “Timeseries data request error”

and nothing else in the “Request” tab.

In the “JS error tab” we have:

Message: “”

Stack trace:
http://192.168.10.5:3000/app/app.6e379bdb.js:20:13510
i@http://192.168.10.5:3000/app/app.6e379bdb.js:10:29775
http://192.168.10.5:3000/app/app.6e379bdb.js:10:29947
$eval@http://192.168.10.5:3000/app/app.6e379bdb.js:12:5251
$digest@http://192.168.10.5:3000/app/app.6e379bdb.js:12:3774
$apply@http://192.168.10.5:3000/app/app.6e379bdb.js:12:5514
h@http://192.168.10.5:3000/app/app.6e379bdb.js:10:14045
q@http://192.168.10.5:3000/app/app.6e379bdb.js:10:15390
v@http://192.168.10.5:3000/app/app.6e379bdb.js:10:15985

OK, I see that it appends “/render”, rather than just “render” to the request…

…I attach a modified version of [tt]DataGraph.lua[/tt] (still compatible with everything else) which should get over this particular problem. You now need to put the following into the Grafana URL box:

vera-ip-address:3480/data_request?id=lr_grafana

and I’m sure we’'l hit the next hurdle then.

Ok, just to be sure … I have uploaded your file via Vera / Develop Apps / Luup Files / Upload.

I guess the original file gets overwritten ?

I have rebooted the VeraEdge box - just to be sure.

It dos not seem to work - yet :wink:

Here is the error reported via Safari / Dev Console:

[Error] XMLHttpRequest cannot load http://192.168.10.51:3480/data_request?id=lr_grafana/render. Origin http://192.168.10.5:3000 is not allowed by Access-Control-Allow-Origin. (new-dashboard, line 0)
[Error] Object
(fonction anonyme) (app.6e379bdb.js, line 10)
(fonction anonyme) (app.6e379bdb.js, line 10)
i (app.6e379bdb.js, line 10)
(fonction anonyme) (app.6e379bdb.js, line 10)
$eval (app.6e379bdb.js, line 12)
$digest (app.6e379bdb.js, line 12)
$apply (app.6e379bdb.js, line 12)
h (app.6e379bdb.js, line 10)
q (app.6e379bdb.js, line 10)
v (app.6e379bdb.js, line 10)
[Error] Object
(fonction anonyme) (app.6e379bdb.js, line 10)
(fonction anonyme) (app.6e379bdb.js, line 10)
i (app.6e379bdb.js, line 10)
(fonction anonyme) (app.6e379bdb.js, line 10)
$eval (app.6e379bdb.js, line 12)
$digest (app.6e379bdb.js, line 12)
$apply (app.6e379bdb.js, line 12)
h (app.6e379bdb.js, line 10)
q (app.6e379bdb.js, line 10)
v (app.6e379bdb.js, line 10)
[Log] Panel data error: (app.6e379bdb.js, line 23)
Object

[quote=“GL29, post:7, topic:187774”]Ok, just to be sure … I have uploaded your file via Vera / Develop Apps / Luup Files / Upload.

I guess the original file gets overwritten ?

I have rebooted the VeraEdge box - just to be sure.[/quote]
Yes, that’s all correct.

It dos not seem to work - yet ;-)

Here is the error reported via Safari / Dev Console:

I’m sorry, but this means nothing to me - I don’t do JavaScript or much web stuff at all.

I do note that the URL is using a POST method, and I’m not sure that Vera’s request handler routine copes with that. Most usually, requests to port 3480 are made with GET methods. Maybe someone else can help us out here.

[quote=“GL29, post:7, topic:187774”]Here is the error reported via Safari / Dev Console:

[Error] XMLHttpRequest cannot load http://192.168.10.51:3480/data_request?id=lr_grafana/render. Origin http://192.168.10.5:3000 is not allowed by Access-Control-Allow-Origin. (new-dashboard, line 0)[/quote]

This is a generic Web (not Vera nor Plugin) issue…
See: http://www.w3.org/TR/cors/
And for example
https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

I’m also trying to get DataYours to work with Grafana. I’m new to both products, so I’m not a font of knowledge on the subject but when I installed your patched lua, Grafana is not able to pull the metrics from the DataYours web UI and on the Vera I see the following message in the LuaUPnP.log:

LuaUPnP.log:02 01/18/16 16:44:03.435 JobHandler_LuaUPnP::REQ_Handler no handler for lr_grafana/metrics/find/?query=* <0x74b6c520>

When I try opening that URL in my browser I also get a “No handler” message.

I know nothing about Grafana, although would love to learn. The mod I made previously was for a specific request which is not the one you showed.

What is the whole syntax of requests you’re wanting to use (and their semantics) ?

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules