Skip to content
Fluentd plugin to collect Docker metrics
Branch: master
Clone or download
Latest commit 76f3b5c Apr 18, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/fluent/plugin Add a missing require Apr 13, 2017
test Use testing frameworks explicitly Nov 6, 2015
CHANGELOG v0.0.2 Nov 22, 2014
Gemfile initial commit Jun 26, 2014 Update Nov 24, 2014
Rakefile add the rake file Nov 22, 2014
fluent-plugin-docker-metrics.gemspec Use testing frameworks explicitly Nov 6, 2015

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.


to be uploaded on Rubygems

Example config

  type docker_metrics
  stats_interval 1m


  • 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 }}')
You can’t perform that action at this time.