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

Advanced Configuration for Prometheus Alerts

Prometheus Alertmanager provides some additional useful features around the management of alerts. These features allow you to customize and tweak your alerts so they are more useful in real-world situations. In this lab, you will have the opportunity to practice using some of these Alertmanager features, including alert grouping, inhibitions, and silences.

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

    Combine the Web Server Down Alerts into a Single Group

    1. Log in to the Prometheus server.

    2. Edit the Alertmanager configuration file:

      sudo vi /etc/alertmanager/alertmanager.yml
      
    3. Add a new node to routing tree to combine the WebServer.*Down alerts:

      route:
      
        ...
      
        routes:
        - receiver: 'web.hook'
          group_by: ['service']
          match_re:
            alertname: 'WebServer.*Down'
      
    4. Load the new configuration:

      sudo killall -HUP alertmanager
      
    5. Check Alertmanager in a web browser at http://<PROMETHEUS_SERVER_PUBLIC_IP>:9093. You should see the Web Server alerts grouped together under the group service="webserver".

  2. Challenge

    Create an Inhibition to Stop the `WebBadGateway` Alert When a `WebServerDown` Alert Is Already Firing

    1. Edit the Alertmanager configuration file:

      sudo vi /etc/alertmanager/alertmanager.yml
      
    2. Add a new inhibit rule:

      inhibit_rules:
      
        ...
      
        - source_match_re:
            alertname: 'WebServer.*Down'
          target_match:
            alertname: 'WebBadGateway'
      
    3. Load the new configuration:

      sudo killall -HUP alertmanager
      
    4. Check Alertmanager in a web browser at http://<PROMETHEUS_SERVER_PUBLIC_IP>:9093. The WebBadGateway should no longer appear. You can click the Inhibited box to make it appear again.

  3. Challenge

    Silence the `WebServer1Down` Alert

    1. Access Alertmanager in a web browser at http://<PROMETHEUS_SERVER_PUBLIC_IP>:9093.

    2. Expand the service="webserver" group.

    3. Locate the alert with alertname="WebServer1Down", and click the Silence button for that alert.

    4. Fill out the Creator and Comment fields, and then click Create.

    5. If you return to the main Alertmanager page, the WebServer1Down should no longer appear.

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