Docker Monitoring – Containers and Microservices

September 15, 2020

Post

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.

Word Image 278

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.

Word Image 279

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.

Word Image 280

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.

Word Image 281

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.


Word Image 282

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”.

Word Image 283

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.

Play with Instana’s APM Observability Sandbox

Announcement, Developer, Product, Thought Leadership
At Instana, we recently improved the installation process for our self-hosted customers. Instana’s self-hosted platform now utilizes a fully Docker based installation process. In a previous blog post, Lessons Learned From Dockerizing...
|
Featured
An ever-increasing number of System architectures and deployment strategies depend on Kubernetes-based environments. Kubernetes (also known as k8s) is an orchestration platform and abstract layer for containerized applications and services. As such,...
|
Announcement, Developer, Product, Thought Leadership
To be successful in Observability, you must have the ability to observe the behavior of a system and derive its health state from it. But deriving the health state of any given...
|

Start your FREE TRIAL today!

As the leading provider of Automatic Application Performance Monitoring (APM) solutions for microservices, Instana has developed the automatic monitoring and AI-based analysis DevOps needs to manage the performance of modern applications. Instana is the only APM solution that automatically discovers, maps and visualizes microservice applications without continuous additional engineering. Customers using Instana achieve operational excellence and deliver better software faster. Visit https://www.instana.com to learn more.