explaingit

prometheus/alertmanager

8,472GoAudience · ops devopsComplexity · 3/5Setup · moderate

TLDR

Alertmanager receives alerts from Prometheus and handles routing them to the right team, grouping related alerts to cut noise, and silencing them during planned maintenance windows.

Mindmap

mindmap
  root((Alertmanager))
    What it does
      Route alerts
      Group notifications
      Silence alerts
    Destinations
      Email
      PagerDuty
      OpsGenie
      Webhooks
    Tools
      amtool CLI
      REST API v2
    Setup
      Binary or Docker
      YAML config file
      Multi-node cluster
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Route Prometheus alerts to email, PagerDuty, or OpsGenie based on team labels and severity

USE CASE 2

Group dozens of related alerts from the same outage into a single notification to reduce on-call noise

USE CASE 3

Create time-bounded silences during maintenance windows to pause alert notifications using amtool

USE CASE 4

Run multiple Alertmanager instances as a cluster for high availability and manage cluster state via the CLI

Tech stack

GoDockerYAMLOpenAPI

Getting it running

Difficulty · moderate Time to first run · 1h+

Requires a running Prometheus instance sending alerts and a YAML config file defining routing rules and notification destinations.

In plain English

Alertmanager is a companion tool to Prometheus, which is a widely-used system for monitoring servers, applications, and infrastructure. When Prometheus detects that something is wrong, such as a server running low on memory or a service responding too slowly, it sends alerts to Alertmanager. Alertmanager then decides what to do with those alerts: where to send them, how to group related ones together, and when to suppress them to avoid flooding on-call teams with redundant noise. The three main things Alertmanager handles are routing, grouping, and silencing. Routing means directing alerts to the right destination based on their labels, such as sending database alerts to the database team and critical alerts to a pager service. Grouping means batching multiple alerts that share the same cause into a single notification, so one database outage does not generate dozens of separate pages. Silencing allows you to mute alerts during planned maintenance windows or while a known issue is already being worked on. Supported notification destinations include email, PagerDuty, OpsGenie, and a generic webhook receiver that can connect to almost anything else. Configuration is done through a YAML file that defines routes as a tree of rules with labels as matching criteria. The README includes a detailed example configuration covering multiple teams, severity levels, and grouping strategies. Alertmanager ships as a precompiled binary for most platforms and is also available as a Docker image. A command-line tool called amtool is bundled with every release and lets you view active alerts, create silences, check routing decisions for hypothetical alerts, and manage the cluster state if you are running multiple Alertmanager instances for redundancy. The API is version 2, follows the OpenAPI specification, and is accessible under the /api/v2 path. The project is part of the official Prometheus organization and follows the same open-source governance as the rest of the ecosystem.

Copy-paste prompts

Prompt 1
Write an Alertmanager YAML config that routes critical alerts to PagerDuty, sends warning alerts to email, and groups them by cluster name and alertname.
Prompt 2
Show me how to create a 4-hour silence in Alertmanager using amtool for a maintenance window on a specific server hostname.
Prompt 3
I am getting alert storms from Prometheus where one root cause fires 50 separate alerts. Configure Alertmanager grouping so these are batched into one notification.
Prompt 4
Write an Alertmanager webhook receiver config that forwards formatted alert payloads to a Slack channel via HTTP POST.
Prompt 5
Set up a 3-node Alertmanager cluster for high availability and explain what the amtool cluster show command tells me about the cluster state.
Open on GitHub → Explain another repo

← prometheus on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.