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

Setting Up Prometheus and Adding Endpoints

In this hands-on lab, we get our monitoring solution up and running by installing Prometheus, Alertmanager, and Grafana, as well as ensuring metrics from all three services are being fed into Prometheus. This gives us a full monitoring platform so we can start performing both infrastructure and application monitoring and everything in between. As we install Prometheus and Alertmanager, we'll also configure our environment so we can easily and effectively change our configurations without any added work.

Google Cloud Platform icon

Path Info

Clock icon Beginner
Clock icon 1h 0m
Clock icon Apr 05, 2019

Contact sales

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

Table of Contents

  1. Challenge

    Set up Prometheus

    1. On the monitoring server, create a user for Prometheus.
    2. Create the needed directories: /etc/prometheus and /var/lib/prometheus.
    3. Set the ownership of the /var/lib/prometheus directory.
    4. Download Prometheus (here's the link).
    5. Extract the files.
    6. Move the configuration file to /etc/prometheus and set the owner to the prometheus user.
    7. Move the binaries and set the owner.
    8. Create the service file.
    9. Start Prometheus and make sure it automatically starts on boot.
  2. Challenge

    Set up Alertmanager

    1. On the monitoring server, create the alertmanager system user.
    2. Create the needed directory: /etc/alertmanager.
    3. Download Alertmanager (here's the link).
    4. Extract the files.
    5. Move the binaries.
    6. Set the ownership of the binaries.
    7. Move the configuration file into the /etc/alertmanager directory.
    8. Set the ownership of the /etc/alertmanager directory.
    9. Create the alertmanager.service file for systemd.
    10. Stop Prometheus, and then update the Prometheus configuration file to use Alertmanager.
    11. Reload systemd, and then start the prometheus and alertmanager services.
    12. Make sure alertmanager starts on boot.
  3. Challenge

    Set up Grafana

    1. On the grafana server, install the prerequisite libfontconfig package.
    2. Download and install Grafana using the .deb package provided on the Grafana download page.
    3. Start Grafana.
    4. Ensure Grafana starts at boot.
    5. Using the Grafana IP address listed on the lab page, access Grafana's web UI by navigating to <GRAFANA_IP_ADDRESS>:3000 in a new browser tab.
    6. Log in with the username admin and the password admin. Reset the password when prompted.
    7. Click Add data source on the home page.
    8. Select Prometheus.
    9. In the HTTP section, set the URL to http://<MONITORING_IP_ADDRESS>:9090 (using the public IP of the monitoring server provided on the lab page).
    10. Click Save & Test.
  4. Challenge

    Add Alertmanager and Grafana Endpoints to Prometheus

    1. On the monitoring server, open the Prometheus configuration file.
    2. Add the Alertmanager endpoint.
    3. Add the Grafana endpoint.
    4. Restart Prometheus.
    5. Using the public IP address of the monitoring server, navigate to the Prometheus web UI in a new browser tab:http://<MONITORING_IP_ADDRESS>:9090
    6. Ensure all three endpoints are listed on the Targets page.

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