anryko / grafana-influx-dashboard

Grafana InfluxDB scripted dashboard
MIT License
132 stars 44 forks source link

Does this work with Graphite back end? #49

Closed druchoo closed 8 years ago

druchoo commented 8 years ago

Project is written and tested with CollectD->InfluxDB+(input_plugins.collectd) as a system stats collector but with minor configuration changes should be collector independent.

Are you referring to collectd or InfluxDB as the collector? Running Graphite/Grafana and curious if this this work..

anryko commented 8 years ago

Hi, By collector I mean collectd. InfluxDB I consider to be a storage. Getdash has hardcoded queries in influxdb SQL so it is not storage independent.

However, what getdash does is really straightforward. It gets all series from the sotrage and parses them according to plugins 'graph' configuration. Afterwards it generates Grafana dashboard JSON and returns it.

Here is how series from influxdb looks on the input:

$ curl -sG 'http://localhost:8086/query?pretty=true' --data-urlencode "db=collectd" --data-urlencode "q=SHOW SERIE WHERE host = 'vagrant-ubuntu-precise-64';" | grep disk
                            "disk_read,host=vagrant-ubuntu-precise-64,instance=sda,type=disk_merged"
                            "disk_read,host=vagrant-ubuntu-precise-64,instance=sda,type=disk_octets"
                            "disk_read,host=vagrant-ubuntu-precise-64,instance=sda,type=disk_ops"
                            "disk_read,host=vagrant-ubuntu-precise-64,instance=sda,type=disk_time"
                            "disk_read,host=vagrant-ubuntu-precise-64,instance=sda1,type=disk_merged"
                            "disk_read,host=vagrant-ubuntu-precise-64,instance=sda1,type=disk_octets"
                            "disk_read,host=vagrant-ubuntu-precise-64,instance=sda1,type=disk_ops"
                            "disk_read,host=vagrant-ubuntu-precise-64,instance=sda1,type=disk_time"
                            "disk_write,host=vagrant-ubuntu-precise-64,instance=sda,type=disk_merged"
                            "disk_write,host=vagrant-ubuntu-precise-64,instance=sda,type=disk_octets"
                            "disk_write,host=vagrant-ubuntu-precise-64,instance=sda,type=disk_ops"
                            "disk_write,host=vagrant-ubuntu-precise-64,instance=sda,type=disk_time"
                            "disk_write,host=vagrant-ubuntu-precise-64,instance=sda1,type=disk_merged"
                            "disk_write,host=vagrant-ubuntu-precise-64,instance=sda1,type=disk_octets"
                            "disk_write,host=vagrant-ubuntu-precise-64,instance=sda1,type=disk_ops"
                            "disk_write,host=vagrant-ubuntu-precise-64,instance=sda1,type=disk_time"

So if graphite storage can return similar series format it shouldn't be very complicated to adapt existing code for graphite. Because of differences in query language which is tied in with plugin configuration parameters, plugin configs will probably be a bit different...

Unfortunately I'm not familiar with graphite and would have to spend some time investigating it to have a more concrete answer :). This all is just my thought flow in writing...

Short answer is no, it will not work with graphite storage as a series backend.