vimeo / graph-explorer

A graphite dashboard powered by structured metrics
http://vimeo.github.io/graph-explorer/
Apache License 2.0
1.06k stars 93 forks source link

No Graphs, Just Lists #48

Closed jflowers closed 10 years ago

jflowers commented 10 years ago

I can list metrics but cannot graph them. What might I be doing wrong?

I am using Sensu to feed Graphite with metrics. Here is an example from my local Vagrant env: localhost.localdomain.cpu.total.user localhost.localdomain.cpu.total.system etc...

I have run upload metrics successfully: [gexplorer@localhost ~]$ ./update_metrics.py 2013-10-13 23:14:07,385 - update_metrics - INFO - fetching/saving metrics from graphite... 2013-10-13 23:14:07,610 - update_metrics - INFO - generating structured metrics data... 2013-10-13 23:14:07,610 - update_metrics - DEBUG - loading metrics 2013-10-13 23:14:07,611 - update_metrics - DEBUG - removing outdated targets 2013-10-13 23:14:08,439 - update_metrics - DEBUG - removed 0 metrics from elasticsearch 2013-10-13 23:14:08,440 - update_metrics - DEBUG - updating targets 2013-10-13 23:14:08,591 - update_metrics - DEBUG - indexed 13 metrics 2013-10-13 23:14:08,591 - update_metrics - INFO - success!



When I query the elasticsearch server I get some metric indexes: [gexplorer@localhost ~]$ curl http://localhost:9200/_search?pretty { "took" : 1, "timed_out" : false, "_shards" : { "total" : 1, "successful" : 1, "failed" : 0 }, "hits" : { "total" : 37, "max_score" : 1.0, "hits" : [ { "_index" : "graphite_metrics", "_type" : "metric", "_id" : "localhost.localdomain.cpu.total.irq", "_score" : 1.0, "_source" : {"tags": ["what=unknown", "plugin=catchall", "target_type=unknown", "source=unknown", "unit=unknown", "n1=localhost", "n2=localdomain", "n3=cpu", "n4=total", "n5=irq", "n6=", "n7="]} }, { "_index" : "graphite_metrics", "_type" : "metric", "_id" : "localhost.localdomain.cpu.intr", "_score" : 1.0, "_source" : {"tags": ["what=unknown", "plugin=catchall", "target_type=unknown", "source=unknown", "unit=unknown", "n1=localhost", "n2=localdomain", "n3=cpu", "n4=intr", "n5=", "n6=", "n7="]} }, { "_index" : "graphite_metrics", "_type" : "metric", "_id" : "localhost.localdomain.cpu.total.steal", "_score" : 1.0, "_source" : {"tags": ["what=unknown", "plugin=catchall", "target_type=unknown", "source=unknown", "unit=unknown", "n1=localhost", "n2=localdomain", "n3=cpu", "n4=total", "n5=steal", "n6=", "n7="]} }, { "_index" : "graphite_metrics", "_type" : "metric", "_id" : "localhost.localdomain.cpu.cpu0.guest", "_score" : 1.0, "_source" : {"tags": ["what=unknown", "plugin=catchall", "target_type=unknown", "source=unknown", "unit=unknown", "n1=localhost", "n2=localdomain", "n3=cpu", "n4=cpu0", "n5=guest", "n6=", "n7="]} }, { "_index" : "graphite_metrics", "_type" : "metric", "_id" : "carbon.agents.localhost_localdomain-a.memUsage", "_score" : 1.0, "_source" : {"tags": ["what=bytes", "plugin=carbon", "target_type=gauge", "agent=localhost_localdomain-a", "type=carbon_mem", "unit=B"]} }, { "_index" : "graphite_metrics", "_type" : "metric", "_id" : "localhost.localdomain.cpu.cpu0.irq", "_score" : 1.0, "_source" : {"tags": ["what=unknown", "plugin=catchall", "target_type=unknown", "source=unknown", "unit=unknown", "n1=localhost", "n2=localdomain", "n3=cpu", "n4=cpu0", "n5=irq", "n6=", "n7="]} }, { "_index" : "graphite_metrics", "_type" : "metric", "_id" : "localhost.localdomain.cpu.ctxt", "_score" : 1.0, "_source" : {"tags": ["what=unknown", "plugin=catchall", "target_type=unknown", "source=unknown", "unit=unknown", "n1=localhost", "n2=localdomain", "n3=cpu", "n4=ctxt", "n5=", "n6=", "n7="]} }, { "_index" : "graphite_metrics", "_type" : "metric", "_id" : "carbon.agents.localhost_localdomain-a.committedPoints", "_score" : 1.0, "_source" : {"tags": ["what=datapoints", "plugin=carbon", "target_type=gauge", "agent=localhost_localdomain-a", "type=committed", "unit=datapoints"]} }, { "_index" : "graphite_metrics", "_type" : "metric", "_id" : "localhost.localdomain.cpu.cpu0.nice", "_score" : 1.0, "_source" : {"tags": ["what=unknown", "plugin=catchall", "target_type=unknown", "source=unknown", "unit=unknown", "n1=localhost", "n2=localdomain", "n3=cpu", "n4=cpu0", "n5=nice", "n6=", "n7="]} }, { "_index" : "graphite_metrics", "_type" : "metric", "_id" : "localhost.localdomain.cpu.cpu0.iowait", "_score" : 1.0, "_source" : {"tags": ["what=unknown", "plugin=catchall", "target_type=unknown", "source=unknown", "unit=unknown", "n1=localhost", "n2=localdomain", "n3=cpu", "n4=cpu0", "n5=iowait", "n6=", "n7="]} } ] } }



I can list the cpu metrics in the graph explorer web app: GEQL == list cpu total

Statement list Limit 500 Patterns target_type=unit=cputotal Group by target_type=unit=server Aggregation avg by none, sum by none X-axis from -24hours, to now Y-axis min None, max None Targets matching 9/37 Graphs matching 0/0 Graphs from matching targets 0 Total graphs 0 Tag legend whattarget_typesourceunitn1n2n3n4n5n6n7plugin localhost.localdomain.cpu.total.user localhost.localdomain.cpu.total.guest localhost.localdomain.cpu.total.idle localhost.localdomain.cpu.total.softirq localhost.localdomain.cpu.total.irq localhost.localdomain.cpu.total.nice localhost.localdomain.cpu.total.iowait localhost.localdomain.cpu.total.steal localhost.localdomain.cpu.total.system



When I try to graph the cpu totals with the following GEQL I get no graph: GEQL == cpu total

Statement graph Limit 500 Patterns target_type=unit=cputotal Group by target_type=unit=server Aggregation avg by none, sum by none X-axis from -24hours, to now Y-axis min None, max None Targets matching 9/37 Graphs matching 0/0 Graphs from matching targets 1 Total graphs 1 Tag legend whattarget_typesourceunitn1n2n3n4n5n6n7plugin unknownunknownunknownunknownlocalhostlocaldomaincputotalcatchall

Dieterbe commented 10 years ago

can you check your web developer tools in your browser, more specifically the network tab. usually you'll see errors in the console or in one of the network requests.

most often graphite returning CORS errors. (did you do the steps in https://github.com/vimeo/graph-explorer#configuration-of-graphite-server ?)

jflowers commented 10 years ago

Fixed! There were two issues.
1) POST was not in the allowed list 2) the config.py's graphite_url had localhost and it needed to be the real ip or hostname of the server even though they are hosted on the same box

Thanks for the help, you rock!

Dieterbe commented 10 years ago

2) prompted me to open #49 re 1) is there anything I can do to prevent other people new to GE missing this too? you're not the first one to miss https://github.com/vimeo/graph-explorer#configuration-of-graphite-server

how do i make this more obvious?

jflowers commented 10 years ago

I have been working with Chef and Vagrant to create test environments. The graphite Chef cookbook does not include the POST config. I corrected it manually but then ran Chef again later and forgot that would overwrite my manual correction. I have since then edited the graphite cookbook to include the POST apache config. I also wrote a graph-explorer cookbook and set the graphite host url from the Vagrantfile to make the host ip of the Vagrant box created.

If you included an example like this in you github account if might help. I would be happy to contribute the the graph-explorer cookbook and Vagrantfile I currently have.

Dieterbe commented 10 years ago

If you included an example like this in you github account if might help

example like what? like a chef cookbook? i don't really want to maintain such a thing but i would gladly point to yours if it's publicly available

jflowers commented 10 years ago

that is what I mean :-) me too, I don't want to maintain a Chef Cookbook

Dieterbe commented 10 years ago

52 will fix most of this problem for other users.