No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
Fluentd input plugin to collect container metrics periodically
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 0.6
~> 10.1

Runtime

~> 1.15
~> 0.10
 Project Readme

Fluentd Docker Metrics Input Plugin

This is a Fluentd plugin to collect Docker metrics periodically.

How it works

It's assumed to run on the host server. It periodically runs Docker Remote API calls to fetch container IDs and looks at /sys/fs/cgroups/<metric_type>/docker/<container_id>/ for relevant stats. You can say this is an implementation of the metric collection strategy outlined in this blog post.

Installing

to be uploaded on Rubygems

Example config

<source>
  type docker_metrics
  stats_interval 1m
</source>

Parameters

  • stats_interval: how often to poll Docker containers for stats. The default is every minute.
  • cgroup_path: The path to cgroups pseudofiles. The default is sys/fs/cgroup.
  • tag_prefix: The tag prefix. The default value is "docker"

Example output

2014-11-22 17:48:26 +0000 docker.blkio.io_queued: {"key":"blkio_io_queued_total","value":0,"type":"counter","hostname":"precise64","id":"24f5fb3bfc429e88aa3dbacd704667899dc496067cedcfa58dd84da42e7cb3cf","name":"/world"}
2014-11-22 17:48:26 +0000 docker.blkio.sectors: {"key":"blkio_sectors","value":136,"type":"counter","hostname":"precise64","id":"24f5fb3bfc429e88aa3dbacd704667899dc496067cedcfa58dd84da42e7cb3cf","name":"/world"}

In particular, each event is a key-value pair of individual metrics. Also, it has

  • hostname is the hostname of the Docker host
  • id is the ID of the container
  • name is the descriptive name of the container (a la docker inspect --format '{{ .Names }}')