Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

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.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 45m
Published
Clock icon Jun 12, 2020

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. Challenge

    Create the Dashboard and Add a Web Server Status Panel

    1. Click the Create button on the left, and then select Dashboard.

    2. Click the Save Dashboard button near the top right. For the dashboard name, enter "LimeDrop Web Server", and then save.

    3. Click the Add Panel button near the top right, and then Add Query.

    4. For the PromQL query, enter:

      up{instance="limedrop-web:9100"}
      
    5. Click the Visualization icon. Click the visualization type dropdown that currently says Graph and change it to Singlestat.

    6. Under Value Mappings, enter two value to text mappings:

      • 1 -> Up
      • 0 -> Down
    7. Click the General icon.

    8. Change the panel title to "Server Status".

    9. Click the back button in the top left. You should see your dashboard, and the Server Status panel should say Up.

    10. Click the Save Dashboard button near the top right, and then Save to save your changes.

  2. Challenge

    Create a CPU Usage Graph Panel

    1. Navigate to the LimeDrop Web Server dashboard.

    2. Click the Add Panel button near the top right, and then Add Query.

    3. For the PromQL query, enter:

      sum(rate(node_cpu_seconds_total{instance='limedrop-web:9100',mode!='idle'}[5m])) * 100
      
    4. Click the General icon, and change the panel title to "CPU Usage".

    5. Click the back button in the top left. You should see your dashboard, and there should be a graph showing CPU utilization.

    6. Click the Save Dashboard button near the top right, and then Save to save your changes.

  3. Challenge

    Create a Memory Usage Graph Panel

    1. Click the Add Panel button near the top right, and then Add Query.

    2. For the PromQL query, enter:

      100 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes) * 100
      
    3. Click the General icon, and change the panel title to "Memory Usage".

    4. Click the back button in the top left. You should see your dashboard, and there should be a graph showing memory utilization.

    5. Rearrange your panels by dragging and dropping them if desired.

    6. Click the Save Dashboard button near the top right, and then Save to save your changes.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

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.

Start learning by doing today

View Plans