Collectd configured to fetch running docker container stats using the stats endpoint introduced in Docker1.5.
The collectd python plugin is used to run a script that communicates with the machine's docker daemon.
A Docker plugin for collectd using docker-py and collectd's Python plugin.
This uses the new stats API (moby/moby#9984) introduced by Docker 1.5
- Network bandwidth
- Memory usage
- CPU usage
- Block IO
- Place
dockerplugin.py
anddockerplugin.db
in/usr/share/collectd
(this is only an example). - Configure the plugin (see below).
- Restart collectd.
Add the following to your collectd config:
TypesDB "/usr/share/collectd/dockerplugin.db"
LoadPlugin python
<Plugin python>
ModulePath "/usr/share/collectd"
Import "dockerplugin"
<Module dockerplugin>
BaseURL "unix://var/run/docker.sock"
</Module>
</Plugin>
- docker-py
- python-dateutil
- docker 1.5+