Docker plugin

Docker is the world’s leading software containerization platform. Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud. Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment.

More information on: https://www.docker.com/

How it works

The CoScale agent detects running containers on your system and starts gathering resources without any configuration. To have a more in-depth view on the process within the container you need to active the CoScale incontainer monitoring system.

The in-container system uses CoScale plugins to gather data from the process running in the container. You can find a full list of our plugins on the Agent page. CoScale requires some configuration to be able to detect which containers to monitor. You can find more information in the configuration section

The plugin will be started within the namespace of the running container, this has the advantage that you do not have to expose any ports or mount the filesystem for the CoScale in-container monitoring to be able to do its job.

Configuration

Go the agent page by going to Datasources > Agent in the sidebar. Click configure next to the agent you want to update.

Monitor based on Docker labels

The agent will automatically start to monitor all Docker containers which have a label that starts with com.coscale.monitoring and contains a list of plugins and their configuration. These labels can be generated by clicking on the Generate Docker labels button under the configuration pane. You can mark an image to be monitored by placing the generated label in your Dockerfile:

LABEL com.coscale.monitoring='[{"PluginType":"GENERICSCRIPT","Configuration":{"SCRIPT":["/script.sh"]}}]'

For already existing images the label can also be specified when creating containers, in the docker run command via the --label or --label-file options:

docker run -d --label com.coscale.monitoring='[{"PluginType":"CASSANDRA","Configuration":{"JMX HOSTNAME":["localhost"],"JMX PORT":["7199"]}}]' cassandra

Note that if the container’s base image already has the ‘com.coscale.monitoring’ label, adding it again on docker run will overwrite the configuration in the base image. If instead want to extend the list of plugins defined in the base image, you can use a different label name in the docker run command, for example com.coscale.monitoring.extra.

You can find some more example images on our Github repository, including prebuild images on our Docker Hub.

Configure the CoScale Docker agent with image detection

An alternative option is to add each Docker image that you would like to monitor to our UI, you also need to add a set of plugins to be installed when a container with your image is running. Our image and tag detection can use wildcards, so “jboss-*” will trigger on all images that start with “jboss”. After adding a plugin, you will receive instructions on how to setup your Docker container so that our agent can monitor it.

Screenshot of Docker configuration

Events

  • Events reported by Docker
    • Container created
    • Container started
    • Container stopped
    • Container died
    • Container destroyed
    • Container killed
    • Container attach
  • Events generated when ‘docker exec’ is called
    • Creating a plugin inside a container
    • Starting a plugin inside a container
    • Command was ran inside a container
  • Docker service state watcher

Metrics

Metric name Metric unit
Docker container total cpu usage %
Docker container block IO read rate b/s
Docker container block IO write rate b/s
Docker container free memory bytes b
Docker container free memory percentage %
Docker container kernel mode cpu usage %
Docker container memory limit b
Docker container memory usage bytes b
Docker container memory usage percentage %
Docker container network receive errors total #
Docker container network receive packets dropped total #
Docker container network receive rate b/s
Docker container network transmit errors total #
Docker container network transmit packets dropped total #
Docker container network transmit rate b/s
Docker container number of CLOSE_WAIT connections #
Docker container number of CLOSING connections #
Docker container number of ESTABLISHED connections #
Docker container number of FIN_WAIT1 connections #
Docker container number of FIN_WAIT2 connections #
Docker container number of LAST_ACK connections #
Docker container number of LISTEN connections #
Docker container number of SYN_RECV connections #
Docker container number of SYN_SENT connections #
Docker container number of TIME_WAIT connections #
Docker container pgfault memory failures total #
Docker container pgmajfault memory failures total #
Docker container shm memory free bytes b
Docker container shm memory free percent %
Docker container shm memory limit b
Docker container shm memory used bytes b
Docker container user mode cpu usage %
Docker running %
Number of bytes of page cache memory b
The amount of anonymous and swap cache memory(includes transparent hugepages) b
The amount of swap currently used b
The amount of working set memory, this includes recently accessed memory, dirty memory, and kernel memory b