This is the source for redmatter/collectd-elk
docker image. It facilitates the collection of docker statistics into
ELK stack.
Th prerequisite to using this would be to have a functional ELK stack. For use in development environment an ELK stack
can be deployed using the redmatter/docker-elk
project. Once deployed, use
the commands below to deploy the collectd-elk
container.
export LOGSTASH_NETWORK=<network-name>
docker-compose up -d
Here the network name to be defined in LOGSTASH_NETWORK
would be dockerelk_logstash
by default. Use
docker network ls
to find out the exact name.
NOTE: If you have a hostname specified with hyphens (-
), the hostname will be modified to remove them. For example, if hostname is api-01
, the host
field in index entries will be api01
The image supports a couple of environment variables to tune its behaviour.
Sets the hostname added to each event generated by collectd. If this variable is not set, and if you have
/etc/hostname
volume mounted in as /host/hostname
(as seen in the docker-compose.yml
), or
if you have the host's /proc
volume mounted in as /host/proc
, then they are utilised to figure out the hostname.
Otherwise it falls back to the default behaviour, which is to use container's ID.
Controls how often the stats are collected and exposed by collectd. By default, it is 10 seconds
.
You can also configure it via collectd config in /etc/collectd/collectd.conf
.