Configuring Prometheus Alertmanager

30 minutes
  • 2 Learning Objectives

About this Hands-on Lab

Prometheus Alertmanager provides useful functionality around processing and managing alerts triggered by your Prometheus metric data. In this lab, you will have the opportunity to gain some hands-on experience with the process of configuring Alertmanager itself. You will be able to work with a real Alertmanager instance, making configuration changes to it.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Set the `from` Address for Email Alerts
  1. Log in to the Prometheus server.

  2. Edit the Alertmanager configuration file:

    sudo vi /etc/alertmanager/alertmanager.yml
  3. Set global.smtp_from to noreply@limedrop.com:

    global:
      smtp_from: noreply@limedrop.com
    
    ...
Add the Requested Templates Directory
  1. Edit the Alertmanager configuration file:

    sudo vi /etc/alertmanager/alertmanager.yml
  2. Add the requested directory as a notification template location:

    templates:
      - "/etc/alertmanager/templates/*.tmpl"
  3. Restart Alertmanager to load the new configuration:

    sudo systemctl restart alertmanager
  4. Verify your configuration is valid by ensuring Alertmanager is running. Access Alertmanager in your browser: http://<PROMETHEUS_SERVER_PUBLIC_IP>:9093

  5. Once you can see Alertmanager in your browser, click Status and look for your new configuration options in the Config section.

Additional Resources

Your company, LimeDrop, has recently set up an Alertmanager instance to handle alerts from a Prometheus server. However, after using Alertmanager for a week, it has become apparent that a few configuration tweaks are needed. Implement the requested configuration changes in the existing Alertmanager instance running on the Prometheus server.

If you wish, you can read more about the configuration options available for Alertmanager in the Prometheus documentation.

Implement the following configuration changes:

  • The company would like email alerts to have a from address of noreply@limedrop.com to ensure users know they should not directly reply to alert emails.
  • Alertmanager has the ability to load notification templates from files. The company would like to give some employees the ability to add new templates without giving them access to the entire Prometheus server. As such, a special directory has been created with appropriate permissions in order to house these templates. Configure Alertmanager to read templates from the directory located at /etc/alertmanager/templates/.

What are Hands-on Labs

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.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?