Learn
WebsiteLoginFree Trial
  • Incident Management
    • What is Incident Management? Beginner's Guide
    • Severity Levels
    • How to calculate MTTR and Other Common Incident Recovery Metrics
    • On-Call
    • SLA vs SLO vs SLI: What's The Difference?
    • Data Aggregation and Aggregators
  • DevOps
    • Best DevOps Tools for Each Phase of the DevOps Lifecycle
      • Best DevOps Planning Tools
      • Best DevOps Coding Tools
      • Best DevOps Build Tools
      • Best DevOps Testing Tools
      • Best DevOps Release Tools
      • Best DevOps Deployment Tools
      • Best DevOps Operations Tools
      • Best DevOps Monitroing Tools
    • What is DevOps?
      • Best CI/CD Tools
      • DevOps Infrastructure and Automation
      • What is a DevOps Pipeline?
      • DevOps Vs. Agile
      • Top 25 DevOps Interview Questions
      • What Are the Benefits of DevOps?
      • What is CI/CD?
      • What is a DevOps Engineer?
      • What is DevSecOps?
    • What is Observability?
      • USE and RED Method
    • What is Site Reliability Engineering (SRE)?
      • Four Golden Signals: SRE Monitoring
      • What is A Canary Deployment?
      • What is Blue-Green Deployment?
  • Docker
    • Overview
    • Dockerfile
    • Images
    • Containers
    • Storage
    • Network
    • Compose
    • Swarm
    • Resources
  • prometheus
    • Overview
    • Data Model
    • Metric Types
    • PromQL
      • Series Selection
      • Counter Rates & Increases
    • Pushgateway
    • Alertmanager
    • Remote Storage
Powered by GitBook
On this page
  • What is Alertmanager?
  • Features
  • Grouping
  • Inhibition
  • Silences
  • Config File
  • Notification Templates
  • High Availability

Was this helpful?

  1. prometheus

Alertmanager

Alertmanager handles alerts generated by Prometheus. It manages the routing, grouping, and notification of alerts to various integrations such as email and webhooks.

PreviousPushgatewayNextRemote Storage

Last updated 1 year ago

Was this helpful?

What is Alertmanager?

is responsible for handling alerts sent by client applications such as and then managing those alerts by grouping, deduplicating, routing, and sending them to various receiver integrations like email, webhook, , etc.

Features

Key features of Alertmanager include:

  1. Grouping: Similar alerts can be grouped together to avoid overwhelming the users with redundant notifications.

  2. Inhibition: Prevents certain alerts from firing if another specific alert is already open. This helps prevent flooding with redundant notifications.

  3. Silencing: Administrators can silence certain alerts during maintenance or in response to known issues, preventing unnecessary notifications.

  4. Routing: Alerts can be routed to different destinations based on certain criteria, such as severity level, alert type, or specific attributes.

Grouping

Example: Your database goes down, and all services can no longer reach it. Prometheus' alerting rules were configured to send an alert for each service that cannot communicate with the database. As a result, many alerts were sent to Alertmanager. Alertmanager groups these alerts into one and sends a single alert/notification.

Inhibition

Example: An alert is firing about an entire cluster that is not reachable. Alertmanager is configured to inhibit all other alerts concerning the cluster if this alert condition is already firing. This prevents duplicate alerts/notifications from being sent that might be downstream from the actual issue.

Silences

Silences are a way to mute alerts for a given time. Silences are configured in the web interface of Alertmanager.

Example: Incoming alerts are checked to see whether they match all the equality or regular expression matches of active silence. If they do, no notifications will be sent out for that alert.

Config File

./alertmanager --config.file=alertmanager.yml

The following is an example configuration file:

alertmanager.yml
global:
  # Define the external URL where Alertmanager can be reached.
  resolve_timeout: 5m

route:
  # Group alerts by severity level
  group_by: ['severity']

  # Send critical alerts to the pagertree receiver
  routes:
    - match:
        severity: critical
      receiver: 'pagertree'

    # Send all other alerts to the email receiver
    - receiver: 'email'

receivers:
  - name: 'email'
    email_configs:
      - to: '[email protected]'
        from: '[email protected]'
        smarthost: 'smtp.example.com:587'
        auth_username: 'username'
        auth_password: 'password'
        require_tls: true

  - name: 'pagertree'
    webhook_configs:
      - url: 'https://api.pagertree.com/integration/int_xxx'

inhibit_rules:
  # Inhibit critical alerts if a certain other alert is firing
  - source_match:
      severity: 'critical'
    target_match:
      severity: 'warning'
    equal: ['alertname', 'service']

Notification Templates

global:
  slack_api_url: '<slack_webhook_url>'

route:
  receiver: 'slack-notifications'
  group_by: [alertname, datacenter, app]

receivers:
- name: 'slack-notifications'
  slack_configs:
  - channel: '#alerts'
    text: 'https://internal.myorg.net/wiki/alerts/{{ .GroupLabels.app }}/{{ .GroupLabels.alertname }}'

High Availability

Do not load balance traffic between Prometheus and Alertmanager. Instead, point Prometheus to a list of all Alertmanagers.

Integration: Supports integration with various notification systems and channels like email, webhook, , etc.

Grouping categorizes alerts with a similar into a single notification. The group is configured by a routing tree in the .

Inhibition suppresses notifications for certain alerts if certain other alerts are already firing. Inhibitions are configured through the Alertmanager .

Alertmanager is configured via command-line flags and a configuration file (YAML format). The can be found in the official docs, and the can be used to help build route trees.

Notifications sent to receivers are constructed via . Alertmanager comes with default templates, but they can also be customized.

By default, Alertmanager starts in high availability mode. To configure the Alertmanager cluster, use the flags.

PagerTree
full YAML scheme
visual editor
templates
cluster-*
configuration file
Alertmanager
Prometheus
PagerTree
configuration file
Prometheus Alertmanager Architecture
Prometheus Alertmanager Architecture
label set