When it comes right down to it, there are many different types of Docker monitoring but most people don’t realize how many layers of monitoring are required to understand the performance and health of Docker services.
What is Docker?
Docker … use[s] OS-level virtualization to deliver software in packages called containers. Containers are isolated from one another and bundle their own software, libraries and configuration files; they can communicate with each other through well-defined channels. All containers are run by a single operating system kernel and therefore use fewer resources than virtual machines. (Wikipedia)
That said, Docker is a set of tools, spearheaded by the actual Daemon process that uses Linux Kernel features (like Namespaces and CGroups) to run fully isolated processes inside the same Kernel process. That proves to be an extremely lightweight way of “virtualization”, also known as OS-level virtualization. Similar technologies exist in other operating systems, such as Solaris Zones, and FreeBSD Jails.
Furthermore, Docker provides the necessary tools to create, bundle, manage and publicly or privately provide the necessary (filesystem) images for such containers running supervised by the Docker daemon.
Originally developed by Docker Inc., Docker is integrated with many different services and products as the underlying runtime engine to operate the containers. Systems using Docker include Kubernetes, OpenShift, Docker’s Swarm and others.
Basic Docker Monitoring
Monitoring Docker, no matter if used purely or integrated into one of the systems mentioned above, should include aspects of health, performance, and resource usage of the containers. Failures in the daemon directly influence the health of the system as a whole. There are many ways to monitor basic Docker indicators. Docker Stats: The easiest tool to use and monitor Docker containers is Docker Stats, which is built into the actual Docker CLI (command line interface). Replicating much of the style known from famous Linux tools like top or iotop, it provides information about container names, CPU, memory and io (block device and network) usage.
cAdvisor and Prometheus: Runtime information together with other important metrics can be picked up with cAdvisor and be sent to a system like Prometheus. The combination of those two components is a very typical setup, especially due to the deep integration of cAdvisor into Kubernetes.
Source: How to monitor docker containers using cAdvisor [Part 1]
Docker Events: An often overlooked part in monitoring of Docker containers is Docker Events, providing insight into what’s going on with the services. A service constantly dying is certainly alarming and therefore those events should be captured and analyzed.
Docker and Microservices
Accessing Docker and Docker container metrics using open-source (OSS) monitoring tools is useful but very likely to forget important bits of information like container events or logs. Furthermore, a lot of work is left up to the user when trying to understand the actual impact of the services running supervised by Docker and their resource impact on each other. Another important thing to note is that the infrastructure to collect, store, and analyze the metrics (oftentimes Prometheus) must be set up and managed. Prometheus, while good, was not designed to scale out for monitoring at large scale so be prepared to manage multiple instances over time.
To make things even more complicated, correlating metrics from Docker and the containers with data (like metrics or distributed traces) from the microservices or applications running inside the containers is missing when using the standard OSS tools available. As a result the user is left alone with a set of independent metrics, disconnected from each other and often spread across disparate monitoring systems. Piecing those together resembles a jigsaw puzzle. Connecting the dots during an outage situation, as well as getting to the root cause is an unnecessarily complicated and lengthy process and significantly increases the Time to Resolution.
Full Stack Docker Monitoring with Instana
Instana automatically discovers and monitors Docker daemons and containers:
- Resource Usage
- Container Events
- Newly started or stopped containers
Instana automatically discovers Docker instances running on the Docker host, or on managed environments like Kubernetes. Furthermore, the Instana Agent analyzes any newly started or already running Docker container for supported technologies and immediately starts monitoring those components as well.
After installation of the Instana Agent, configuration is typically automatic. Installation of the Instana Agent depends on the system to be monitored, and ranges from a one-liner installation with virtual machines or physical hosts, to a single Helm installation within Kubernetes or OpenShift. The Installation Wizard inside Instana’s Web Interface provides the user with a choice of setup techniques by environment.
It’s important to understand that Instana not only monitors the Docker daemon and container metrics or events, but also immediately starts monitoring every service deployed using the containers. This provides end-to-end visibility across the overall system’s stack and offers automatic distributed tracing of every request throughout all services.
After the Instana agent starts, every container under supervision of the Docker daemon on the given host is scanned for supported technologies, automatically set up to be monitored, and added to Instana. Instana’s single agent per host implementation keeps the monitoring overhead extremely low and greatly simplifies the overall installation and maintenance process.
Using Instana to collect all important metrics and traces brings the benefit that Instana stitches together all information to provide a full, end to end view of the contextual dependencies and impact between the different components.
With Instana there is no need to manually determine which performance degradation in a service is related to resource contention on the host running Docker. Instana automatically determines the relationships between all system components and continuously records which container instance was running on which host at any specific point in time. That offers correlations such as “multiple services on the same Docker host have performance issues at the same time due to congestion of memory over usage”.
Every technology monitored by Instana, Docker monitoring included, provides automatic and continuous discovery, dependency mapping, metrics monitoring, anomaly detection, and filter based analytics across the full stack. Play with Instana’s Docker monitoring by using our interactive sandbox observability environment today.