- Lab
- A Cloud Guru
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.
Path 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.
-
What's a lab?
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.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.