DISCONTINUATION OF PROJECT.
This project will no longer be maintained by Intel.
This project has been identified as having known security escapes.
Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.
Intel no longer accepts patches to this project.
This project will no longer be maintained by Intel. Intel will not provide or guarantee development of or support for this project, including but not limited to, maintenance, bug fixes, new releases or updates. Patches to this project are no longer accepted by Intel. If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the community, please create your own fork of the project.
This plugin collects runtime metrics from Docker containers and its host machine. It gathers information about resource usage and performance characteristics.
It's used in the Snap framework.
In order to use this plugin you need Docker Engine installed. Visit Install Docker Engine for detailed instructions how to do it. Plugin was tested against Docker version 1.12.3.
- Linux/amd64
- Darwin/amd64 (needs docker-machine)
You can get the pre-built binaries for your OS and architecture from the plugin's GitHub Releases page. Download the plugin from the latest release and load it into snapteld
(/opt/snap/plugins
is the default location for Snap packages).
Fork https://github.com/intelsdi-x/snap-plugin-collector-docker
Clone repo into $GOPATH/src/github.com/intelsdi-x/
:
$ git clone https://github.com/<yourGithubID>/snap-plugin-collector-docker.git
Build the Snap docker plugin by running make within the cloned repo:
$ make
It may take a while to pull dependencies if you haven't had them already.
This builds the plugin in ./build/
- Set up the Snap framework
- Load the plugin and create a task, see example in Examples.
It's possible to provide configuration to plugin via task manifest.
In order to setup Docker Remote API endpoint and procfs path in workflow section of a task configuration file it is necessary to include following:
workflow:
collect:
config:
/intel/docker:
endpoint: "<DOCKER_REMOTE_API_ENDPOINT>"
procfs: "<PATH_TO_PROCFS>"
where DOCKER_REMOTE_API_ENDPOINT is an endpoint that is being used to communicate with Docker daemon via Docker Remote API, where PATH_TO_PROCFS is a path to proc filesystem on host.
For more information see Docker Remote API reference
There are a number of other resources you can review to learn to use this plugin:
Notice, that this plugin using default docker server endpoint unix:///var/run/docker.sock
to communicate with docker deamon.
However, adding support for custom endpoints is on Roadmap.
Client instance ready for communication with the given // server endpoint. It will use the latest remote API version available in the // server.
The list of collected metrics is described in METRICS.md.
Similar to dream levels in the movie Inception, we have different levels of examples:
- LEVEL 0: Snap running on your system (Linux only).
- LEVEL 1: Snap runs in a container.
- LEVEL 2: Snap runs in a docker-in-docker container.
For the sake of ease-of-use, these examples are presented in reverse order.
./examples/tasks/run-docker-file.sh
./examples/tasks/run-dockerception.sh
Check if there is some running docker container(s):
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7720efd76bb8 ubuntu "/bin/bash" 35 minutes ago Up 35 minutes prickly_spence
ad5221e8ae73 ubuntu "/bin/bash" 36 minutes ago Up 36 minutes suspicious_mirzakhani
In one terminal window, start the Snap daemon (in this case with logging set to 1 and trust disabled):
$ snapteld -l 1 -t 0
In another terminal window download and load plugins:
$ wget http://snap.ci.snap-telemetry.io/plugins/snap-plugin-collector-docker/latest/linux/x86_64/snap-plugin-collector-docker
$ wget http://snap.ci.snap-telemetry.io/plugins/snap-plugin-publisher-file/latest/linux/x86_64/snap-plugin-publisher-file
$ chmod 755 snap-plugin-*
$ snaptel plugin load snap-plugin-collector-docker
$ snaptel plugin load snap-plugin-publisher-file
You can list all of available metrics:
$ snaptel metric list
Download an example task file and load it:
$ curl -sfLO https://raw.githubusercontent.com/intelsdi-x/snap-plugin-collector-docker/master/examples/tasks/docker-file.json
$ snaptel task create -t docker-file.json
Using task manifest to create task
Task created
ID: 02dd7ff4-8106-47e9-8b86-70067cd0a850
Name: Task-02dd7ff4-8106-47e9-8b86-70067cd0a850
State: Running
See output from snaptel task watch <task_id>
(notice, that below only the fragment of task watcher output has been presented)
$ snaptel task watch 02dd7ff4-8106-47e9-8b86-70067cd0a850
Watching Task (02dd7ff4-8106-47e9-8b86-70067cd0a850):
NAMESPACE DATA TIMESTAMP
/intel/docker/7720efd76bb8/cgroups/cpu_stats/cpu_usage/total 2.146646e+07 2016-06-21 12:44:09.551811277 +0200 CEST
/intel/docker/7720efd76bb8/cgroups/cpu_stats/cpu_usage/kernel_mode 1e+07 2016-06-21 12:44:09.552107446 +0200 CEST
/intel/docker/7720efd76bb8/cgroups/cpu_stats/cpu_usage/user_mode 0 2016-06-21 12:44:09.552146203 +0200 CEST
/intel/docker/ad5221e8ae73/cgroups/cpu_stats/cpu_usage/total 2.146646e+07 2016-06-21 12:44:09.551811277 +0200 CEST
/intel/docker/ad5221e8ae73/cgroups/cpu_stats/cpu_usage/kernel_mode 1e+07 2016-06-21 12:44:09.552107446 +0200 CEST
/intel/docker/ad5221e8ae73/cgroups/cpu_stats/cpu_usage/user_mode 0 2016-06-21 12:44:09.552146203 +0200 CEST
/intel/docker/root/cgroups/cpu_stats/cpu_usage/total 2.88984998661e+12 2016-06-21 12:44:09.551811277 +0200 CEST
/intel/docker/root/cgroups/cpu_stats/cpu_usage/kernel_mode 6.38e+11 2016-06-21 12:44:09.552107446 +0200 CEST
/intel/docker/root/cgroups/cpu_stats/cpu_usage/user_mode 9.4397e+11 2016-06-21 12:44:09.552146203 +0200 CEST
(Keys ctrl+c
terminate task watcher)
These data are published to file and stored there (in this example in /tmp/snap-docker-file.log
).
There isn't a current roadmap for this plugin, but it is in active development. As we launch this plugin, we do not have any outstanding requirements for the next release.
If you have a feature request, please add it as an issue and/or submit a pull request.
This repository is one of many plugins in snap, a powerful telemetry framework. See the full project at http://github.com/intelsdi-x/snap.
To reach out to other users, head to the main framework or visit Slack.
We love contributions!
There's more than one way to give back, from examples to blogs to code updates. See our recommended process in CONTRIBUTING.md.
Snap, along with this plugin, is an Open Source software released under the Apache 2.0 License.
- Author: Marcin Krolik
- Co-authors: Izabella Raulin, Marcin Olszewski
Thank you! Your contribution is incredibly important to us.