Cloud Computing, DevOps

4 Mins Read

Configuration of Alertmanager With MS-Teams and Email

Voiced by Amazon Polly

Introduction

A solid monitoring and alerting system is crucial for keeping your applications running smoothly in modern cloud-native environments. At the heart of the Prometheus ecosystem sits Alertmanager, which deduplicates, groups, and routes alerts so that the right people see them fast, whether through Microsoft Teams, email, or another channel.

When a metric, log, or trace (from Prometheus, Loki, Tempo, etc.) crosses a defined threshold, an alert fires in Prometheus and lands in Alertmanager. From there, you decide how to deliver it: send it straight to Teams or email, or slip it through an adapter like prometheus‑msteams for extra formatting power.

You have three main paths for getting Prometheus alerts in front of your team:

  • Prometheus -> Alertmanager -> Prometheus‑msteams -> Microsoft Teams
  • Prometheus → Alertmanager → Microsoft Teams
  • Prometheus → Alertmanager → Email

Pioneers in Cloud Consulting & Migration Services

  • Reduced infrastructural costs
  • Accelerated application deployment
Get Started

Basic Setup: Prometheus Alert Rules & Alertmanager Configuration

Set up the core components Prometheus and Alertmanager, which will be common across all three approaches. To enable alerting, you must define threshold-based alert rules in Prometheus and connect it to Alertmanager using values.yaml. Prometheus pushes alerts to Alertmanager when a condition is met.

  • Prometheus Alert Rules

Prometheus evaluates conditions using alert rules. These rules define expressions that trigger alerts when certain failure states or thresholds are met. Below is an example to detect when a pod enters a failure state like CrashLoopBackOff, ImagePullBackOff

These rules can be placed in a file like alert-rules.yaml and mounted using Helm.

  • Connecting Prometheus to Alertmanager

To forward alerts to Alertmanager, Prometheus must be configured with the Alertmanager service endpoint. This is done in values.yaml:

Make sure the Alertmanager service is accessible within the Kubernetes cluster at alertmanager:9093.

  • Alertmanager Basic Routing Config

Set up values.yaml for Alertmanager to route incoming alerts. Start with a basic receiver and customize later based on the method (MS Teams, email, etc.):

This connects Prometheus to Alertmanager and sets up basic alert delivery. You can extend it for MS Teams, email, or other notifiers.

Method 1: Using Prometheus-msteams

Previous versions of Alertmanager couldn’t send alerts straight to Microsoft Teams because they didn’t support Adaptive Cards. To work around this, we use the prometheus-msteams adapter as a bridge: it takes Alertmanager’s alerts, converts them into Teams-friendly Adaptive Cards, and delivers them to your chosen channel. Plus, it lets you fully customize your message templates to tailor alerts exactly how you like.

Webhook-URL Setup in Teams: –

  • Create a Team and a channel inside.
  • Go to Channel’s Manage Channel à click on Connectors Edit à Select Incoming Webhook’s Configure à provide name, and click on generate. Copy the Webhook URL.

Configuration Setup:

Prometheus-msteams configuration: Default message template

With customization of alert message:  A sample customized message template

ms

Displaying alert message in MS-Teams:

ms2

Method 2: Direct MS Teams Webhook

Recent Alertmanager versions (from v0.28.1) support Microsoft Teams via webhook_configs with Adaptive Cards. But message customization is more limited than prometheus‑msteams, but you avoid running an extra component.

Setup of Workflow webhook URL in Teams: –

  • Go to Workflow App in Teams. Click on New flow.
  • Select Post to a channel when a webhook request is received -> click on Next -> Select Team’s Team and Team’s Channel, and Click on Create flow. Copy the Webhook URL.

Configuration Setup:

Displaying alert message in MS-Teams:

ms3

Method 3: Sending to Email

Alertmanager can send alerts directly via SMTP to email recipients.

Before setting up the configuration, generate app-password. You can get into Google account manager, go to Security, which you can find here, and generate the app-password. You need to enable 2-factor authentication for your Google account to generate app-password.

Configuration Setup:

Replace the ‘example@gmail.com’ with your email address and replace the password with your app-password.

Conclusion

Alertmanager provides a way to route and manage alerts for modern cloud-native systems. Integrating it with Prometheus and Alertmanager and sending alerts to Microsoft Teams and Email ensures alerts are delivered quickly and effectively to your team.

Whether using prometheus-msteams for advanced customization, direct webhooks for simplicity, or email for traditional workflows, each method offers a reliable way to stay informed.

With proper alert rules, Alertmanager routing, and Helm-based deployment, you build a flexible and efficient alerting system that fits your operational needs.

Drop a query if you have any questions regarding Alertmanager and we will get back to you quickly.

Making IT Networks Enterprise-ready – Cloud Management Services

  • Accelerated cloud migration
  • End-to-end view of the cloud environment
Get Started

About CloudThat

CloudThat is a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.

CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 850k+ professionals in 600+ cloud certifications and completed 500+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training PartnerAWS Migration PartnerAWS Data and Analytics PartnerAWS DevOps Competency PartnerAWS GenAI Competency PartnerAmazon QuickSight Service Delivery PartnerAmazon EKS Service Delivery Partner AWS Microsoft Workload PartnersAmazon EC2 Service Delivery PartnerAmazon ECS Service Delivery PartnerAWS Glue Service Delivery PartnerAmazon Redshift Service Delivery PartnerAWS Control Tower Service Delivery PartnerAWS WAF Service Delivery PartnerAmazon CloudFront Service Delivery PartnerAmazon OpenSearch Service Delivery PartnerAWS DMS Service Delivery PartnerAWS Systems Manager Service Delivery PartnerAmazon RDS Service Delivery PartnerAWS CloudFormation Service Delivery PartnerAWS ConfigAmazon EMR and many more.

FAQs

1. Which method is best for MS Teams integration?

ANS: – If the channel is a stage and you want flashy layouts, prometheus-msteams is your tool. You can use the direct-webhook Adaptive message method for fast setting up configuration, but it has limited customization of message alerts.

2. Can I use multiple receivers in one Alertmanager config?

ANS: – Yes, you can define more receivers and routes and route the alerts based on labels, alert groups, severity, etc.

WRITTEN BY Nallagondla Nikhil

Nallagondla Nikhil works as a Research Intern at CloudThat. He is passionate about continuously expanding his skill set and knowledge base by actively seeking opportunities to learn new skills. Nikhil regularly explores blogs and articles related to various technologies and industry trends to stay up to date with the latest developments in the field.

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!