jondot/graphene

dashboard-autodiscover example doesn't draw graphs

kjoconnor opened this issue · 7 comments

I have the autodiscover example running, it seems to grab the data sources as it draws the correct number of SVG objects in the window and I can see it polling in the Javascript console, but the graphs themselves never show up.

Blank graphs

I get this in the console as well but not sure if this is related:

jquery-1.7.1.min.js:4 Resource interpreted as Script but transferred with MIME type text/json: "http://<hostname>:8000/render?width=500&from=-2hours&until=now&height=400&target=*.stat.requests&uniq=0.30485176341608167&title=*.stat.requests&format=json&jsonp=jQuery171029370606574229896_1347397300623&_=1347397500894".

Hey @kjoconnor my apologies, I'm surprised at myself - I can't understand how I missed your issue!
Is this still relevant? can I assist in any way? - please let me know

hi @jondot I'm having similar challenges, looks like it accesses the dashboard json fine, but doesn't show anything in console or in graphs. My question is whether I can just change the stock autodiscover example to point to the right host and dashboard name and expect it to work or not. Is there more to it than that?

...
g.discover('http://localhost:8080', 'cpu_usage', function(i, url){ return "#dashboard"; }, function(description){
...

Manually calling the same url that graphene tries, seems to work fine:
This URL is called:
http://localhost:8080/dashboard/load/cpu_usage
Which returns:
{"state": {"name": "cpu_usage", "defaultGraphParams": {"width": 400, "from": "-3minutes", "until": "now", "height": 250}, "refreshConfig": {"interval": 60000, "enabled": false}, "graphs": [["target=carbon.agents.mbpro_local-a.cpuUsage", {"target": ["carbon.agents.mbpro_local-a.cpuUsage"]}, "/render?width=400&from=-3minutes&until=now&height=250&target=carbon.agents.mbpro_local-a.cpuUsage&_uniq=0.8438220729584862&title=carbon.agents.mbpro_local-a.cpuUsage"]], "timeConfig": {"startDate": "2013-07-19T10:34:44", "relativeStartUnits": "minutes", "endDate": "2013-07-19T10:34:44", "relativeStartQuantity": "3", "relativeUntilQuantity": "", "startTime": "9:00 AM", "endTime": "5:00 PM", "type": "relative", "relativeUntilUnits": "now"}, "graphSize": {"width": 400, "height": 250}}}

Should that work in Graphene?
Thanks for any tips.

Same problem here. I can see in the apache logs a hit to the graphite dashboard returning a 200, but graphene shows nothing, just the background "diagmonds".

Is the problem in graphene or is it in the example?

I was able to make it work by proxying the requests to Graphite. Looks like a XSS security issue.

Hello, same problem for me. No datas about Graphite shows by "dashboard-autodiscover.html". Could you help ?
Thank you !

Adding on to it. It does not work for me too.

Hi, me neither...
Ok the solution of "origamislayer" works.

Here is how I did it:

go to your apache2 graphite.conf file.
Add following line in your Virualhost Block

Header set Access-Control-Allow-Origin “*”

If you want to know more about what happens, here are my references:
1:
http://harthur.wordpress.com/2009/10/15/configure-apache-to-accept-cross-site-xmlhttprequests-on-ubuntu/
2:
http://enable-cors.org/server_apache.html