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 Grafana Instance to Work with Prometheus Data

Prometheus is a powerful tool for reliably collecting and serving metric data, but its built-in visualization capabilities are limited. Luckily, Prometheus can easily integrate with more robust visualization tools such as Grafana, allowing you to build robust and useful dashboards to get the most out of your data. In this lab, you will have the opportunity to build a Grafana server and configure it to access Prometheus metric data. After completing this lab, you will know how to install Grafana and integrate it with 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

    Install and Run Grafana

    1. Log in to the Grafana server.

    2. Install some required packages:

      sudo apt-get install -y apt-transport-https software-properties-common wget
      
    3. Add the GPG key for the Grafana OSS repository, then add the repository:

      wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
      
      sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
      
    4. Install the Grafana package:

      sudo apt-get update
      
      sudo apt-get install grafana=6.6.2
      
    5. Enable and start the grafana-server service:

      sudo systemctl enable grafana-server
      
      sudo systemctl start grafana-server
      
    6. Make sure the service is in the active (running) state:

      sudo systemctl status grafana-server
      
    7. Verify Grafana is working by accessing it in a web browser at http://<GRAFANA_SERVER_PUBLIC_IP>:3000.

  2. Challenge

    Configure a Prometheus Data Source on the Grafana Server

    1. Log in to Grafana with the username admin and password admin.

    2. Reset the password when prompted.

    3. Click Add data source.

    4. Select Prometheus.

    5. For the URL, enter http://10.0.1.101:9090. Note that 10.0.1.101 is the private IP address of the Prometheus server.

    6. Click Save & Test. You should see a banner that says, Data source is working.

    7. Test your setup by running a query to get some Prometheus data. Click the Explore icon on the left.

    8. In the PromQL Query input, enter a simple query, such as up.

    9. Execute the query. You should see some data appear. If so, congratulations! This data comes from the Prometheus server.

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