anryko/grafana-influx-dashboard

Add plugin for Docker

Closed this issue · 10 comments

oli-g commented

Hi @anryko

I think that supporting the Docker Collectd plugin could be another nice addition to your dashboards. That plugin adoption is emerging within the Docker community (check this post as an example).

What do you think?

Hi @oli-g

Great idea! I'll definitely dig in to it during the weekend.
Thanks!

Didn't succeed in setting up docker plugin to pass statistics to influxdb so far. Encountered reported issue: lebauce/docker-collectd-plugin#37. Will investigate more.

@oli-g does this collectd docker plugin work for you?

oli-g commented

I'm going to try adding the plugin to my collectd Docker image, then I'll get back to you. Thanks for looking into this!

oli-g commented

Here you can find a Collectd Docker image already including the Docker plugin: https://github.com/signalfx/docker-collectd.

They explained their process here: https://signalfx.com/blog/monitoring-docker-at-scale-with-signalfx/.

oli-g commented

@anryko Hey, I would suggest you to run our collectd Docker image with docker-collectd-plugin preinstalled. Just run something like:

docker run \
    -d \
    --name collectd \
    --hostname foo \
    --privileged \
    --volume /proc:/mnt/proc:ro \
    --volume /etc/collectd:/etc/collectd \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    chimeradev/collectd:5.5.0-3

Make sure to add the following lines to your /etc/collectd/collectd.conf:

TypesDB     "/usr/share/collectd/types.db"
TypesDB     "/usr/share/collectd/docker-collectd-plugin/dockerplugin.db"
# ....
<LoadPlugin python>
  Globals true
</LoadPlugin>
# ....
<Plugin python>
   ModulePath "/usr/share/collectd/docker-collectd-plugin"
   LogTraces true
   Interactive false
   Import "dockerplugin"
   <Module dockerplugin>
       BaseURL "unix://var/run/docker.sock"
       Timeout 3
   </Module>
</Plugin>

Now run any other container on the same host: you should be able to see Docker metrics coming to your InfluxDB instance.

@oli-g hey,thanks for detailed howto on your setup. It was very helpful. Please checkout initial implementation and let me know what you think.

I encountered the same issue as with processes extended metrics, when for the same metric in some graphs I want to see instances combined and in others separated. Last time I approached it by splitting metric in to two plugins. However, this time the same approach would look ugly. So I added possibility to setup 'multi': (true|fasle) per graph. Seems to work well for this case.

I'm going to rework processes plugin in the same manner. What do you think about that?

Merged docker plugin.

oli-g commented

@anryko Hi! Sorry for not giving you that feedback. I already tested the new Docker plugin integration, and it looks good to me. Just one question: where should I set 'multi': (true|fasle)?

@oli-g I couldn't find the source files for chimeradev/collectd:5.5.0-3 anywhere on GitHub or the web. Would you mind sharing them for trustability?
Right now it feels wrong to run an unknown container with priviledged access to the docker host.
See https://github.com/ecobytes/collectd-influxdb-grafana-docker/commit/22b8cb634a309e4160c7ee3bd28c2f347e124cb5
Additionally I wonder what https://hub.docker.com/r/olinicola/grafana-collectd-dashboards/ intends to provide.