- Lab
-
Libraries: If you want this lab, consider one of these libraries.
- Cloud

Building a Prometheus Dashboard in Grafana
Prometheus and Grafana create a powerful combination. Grafana allows you to build useful visualizations on top of your Prometheus metric data. In this lab, you will have the opportunity to build a Grafana dashboard to visualize Prometheus metrics. This will give you some hands-on experience with building useful Grafana dashboards on top of Prometheus.

Lab Info
Table of Contents
-
Challenge
Create the Dashboard and Add a Web Server Status Panel
-
Click the Create button on the left, and then select Dashboard.
-
Click the Save Dashboard button near the top right. For the dashboard name, enter "LimeDrop Web Server", and then save.
-
Click the Add Panel button near the top right, and then Add Query.
-
For the PromQL query, enter:
up{instance="limedrop-web:9100"}
-
Click the Visualization icon. Click the visualization type dropdown that currently says Graph and change it to Singlestat.
-
Under
Value Mappings
, enter twovalue to text
mappings:1
->Up
0
->Down
-
Click the General icon.
-
Change the panel title to "Server Status".
-
Click the back button in the top left. You should see your dashboard, and the Server Status panel should say
Up
. -
Click the Save Dashboard button near the top right, and then Save to save your changes.
-
-
Challenge
Create a CPU Usage Graph Panel
-
Navigate to the
LimeDrop Web Server
dashboard. -
Click the Add Panel button near the top right, and then Add Query.
-
For the PromQL query, enter:
sum(rate(node_cpu_seconds_total{instance='limedrop-web:9100',mode!='idle'}[5m])) * 100
-
Click the General icon, and change the panel title to "CPU Usage".
-
Click the back button in the top left. You should see your dashboard, and there should be a graph showing CPU utilization.
-
Click the Save Dashboard button near the top right, and then Save to save your changes.
-
-
Challenge
Create a Memory Usage Graph Panel
-
Click the Add Panel button near the top right, and then Add Query.
-
For the PromQL query, enter:
100 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes) * 100
-
Click the General icon, and change the panel title to "Memory Usage".
-
Click the back button in the top left. You should see your dashboard, and there should be a graph showing memory utilization.
-
Rearrange your panels by dragging and dropping them if desired.
-
Click the Save Dashboard button near the top right, and then Save to save your changes.
-
About the author
Real skill practice before real-world application
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Learn by doing
Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.
Follow your guide
All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.
Turn time into mastery
On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.