In this scenario, you will start monitoring the resources being used by the delivery system.
Monitoring resource usage is key for ensuring basic health of our live systems. In this scenario we will implement a simple solution for basic container monitoring (cAdvisor), but the same idea (we must monitor) applies for other types of infrastructure abstractions, from VMs to bare metal or Kubernetes.
We will change the configuration of our system to include the monitoring tool (orchestrated by docker-compose) and then recreate the entire system.
Now let's get started!
With a simple configuration change, we have been able to start monitoring the resource usage in our CI/CD pipelines.
Next steps would be to create alarms for certain criteria where we might need to take a look and see if there is an anomaly happening.
All the necessary configuration was coded, allowing a full restore of the system at any time.
05 Monitor CI/CD Resources Usage
Add containers monitoring
We will use Google's cAdvisor, a tool that collects resource usage and performance information from running containers.
In order to add cAdvisor to our delivery toolchain, we can use the official docker image.
Your environment already includes an updated docker-compose.yml file which sets up cAdvisor. This is because we are using docker-compose as a basic container orchestration tool for our toolchain. The same approach would be applicable for other orchestrators like Kubernetes (in fact, cAdvisor can expose metrics for a monitoring tool like Prometheus to consume).
You can see the changes made to docker-compose.yml to run cAdvisor by executing this command:
diff docker-compose-before.yml docker-compose.yml