Introduction to Container Monitoring
This introduction to container monitoring explains why we should monitor containers and what is different about monitoring them versus VM's.
Containers make our lives easier in countless ways from development to production to making the world a better place. How do containers make the world a better place you ask? Happy Developers = Happy Life. However, containers introduce entirely different considerations compared to pre-container modes of operation. Monitoring containers is an entirely different beast. Let's take a look at why monitoring containers are different.
What's Different about Monitoring Containers?
You have now created and deployed a couple of containers. Now what? Should I install a monitoring agent inside my container to see what's going on? NO! One of the many benefits of containers is the size of the deployed container. We only install what we need inside the container to allow our applications to run. Nothing more, nothing less.
Containers live a much shorter life than a VM. According to the latest DataDog Container survey, the average lifespan of a container is 2.5 days. With such a high rate of change, it is important that our monitoring software doesn't stand in the way of the speed at which we change our applications.
Additionally, containers have made it very easy to scale applications from 1 to the moon and back blazingly fast. We want to view our application as it changes state and where exactly all the instances of the application are running. Monitoring should be able to cope with these changes and track our application as it scales up and back down.
Monitoring of containers is agentless. That is, we don't install monitoring agents inside of containers. Typically, we monitor containers by running monitoring software in an additional container beside the container workload on every host. These monitoring containers now report on both the host machine as well as containers.
At this point, many people scratch their heads in confusion and ask "How can another container monitor the host and containers running on the host?" Most monitoring containers mount the root filesystem from the host into the container. By mounting the root filesystem into the container, the monitoring application updates when a new process changes states from start to stop or vice versa. Why are we watching processes and not containers? Containers are processes, and that is the magic which monitoring applications transform into statistics by knowing when a process starts and the association between the process and the application.
Which Monitoring Solution is Best for Me?
Choosing the right monitoring solution is more than Open Source vs. Commercial offerings. Some of the things to consider when selecting a solution are whether the solution integrates with your Container Orchestrator, is cloud-based, runs on-premise, application integrations, client tools, and how the community and support are for the solution. Each of these topics on their own can be the decisive factor in choosing a solution or not. I wrote about each of these in detail for The New Stack's Free e-book Monitoring & Management with Docker Containers if you want to explore these topics further.
To better assist your decision process I have created a Monitoring Solution Spider Graph Google Spreadsheet to help with visualizing your goal versus the different offerings.
Monitoring Solution Spider Graph Instructions:
Values range from 1 (least important) to 5 (most important)
- The Monitoring Goal row is the baseline for each category
- Fill in the names in Coloumn A with the monitoring solutions to compare
- Asses the features of the different solutions with the Spider Graph
- Compare Goal baseline values with the different solutions
Once the chart is complete you can visualize the comparison with the Monitoring Solution Spider Graph.
After creating your monitoring comparison, you should be a bit closer to deciding which monitoring solution is best for your project. Where do we go from here? Next, I plan to help you filter through some of the monitoring solutions currently available. The next article will compare the open source and commercial monitoring solutions on the market and the pros and cons of each.
If you liked this article be sure to Follow Me on Twitter to stay updated!