13. Monitoring Docker Metrics
Activity 13.01: Creating a Grafana Dashboard to Monitor System Memory
Solution:
There are a number of ways in which you can perform this activity. The following steps are one such method:
- Make sure that Prometheus is running and collecting data, Docker and
cAdvisor
are configured to expose metrics, and Grafana is running and configured with Prometheus as a data source. - Open the Grafana web interface and the
Container Monitoring
dashboard you created in Exercise 13.05: Installing and Running Grafana on Your System - There is an
Add panel
option at the top of the dashboard and to the right of the dashboard name. Click theAdd panel
icon to add in your new dashboard panel: - Select
Prometheu
s from the drop-down list as the data source we will be using to produce the new dashboard panel. - In the
metrics
section, add the following PromQL query,container_memory_usage_bytes...