config.yaml


Overview

`config.yaml` is a configuration file for **Prometheus Alertmanager**, tailored for the ShapeShift Unchained platform. Its primary purpose is to define how alerts generated by Prometheus are grouped, inhibited, routed, and delivered to various notification channels. This file focuses on managing alert routing logic, inhibition rules to reduce noise, and specifying Discord webhook receivers for sending formatted alert notifications.

The configuration ensures that alerts of different severities (`critical`, `warning`, `info`) and environments (`production` vs `development`) are handled appropriately to enable effective incident response. It also uses templates for consistent, readable alert messages in Discord.


Detailed Explanation of Configuration Sections

This file consists of several key sections:

1. global


2. inhibit_rules

- source_matchers:
    - "severity = critical"
  target_matchers:
    - "severity =~ warning|info"
  equal:
    - "namespace"
    - "alertname"

This means: If a critical alert is firing for a given `namespace` and `alertname`, then all warning or info alerts with the same `namespace` and `alertname` are inhibited.


3. route

Each route specifies:

- receiver: "discord_critical"
  group_by: ["alertname", "namespace", "statefulset"]
  group_wait: 5m
  group_interval: 30m
  repeat_interval: 1h
  matchers:
    - alertname = "UnchainedStatefulSetDown"
    - namespace = "unchained"
    - severity = "critical"

This routes critical statefulset down alerts in the `unchained` namespace to the `discord_critical` receiver.


4. receivers


5. templates


Important Implementation Details


Interaction with Other System Components


Usage Examples

Sending a Critical Alert for StatefulSet Down in Production Namespace

When Prometheus fires an alert with labels:

alertname: UnchainedStatefulSetDown
namespace: unchained
severity: critical
statefulset: my-statefulset

Visual Diagram

flowchart TD
    A[Prometheus] -->|Sends Alerts| B[Alertmanager]

    B -->|Applies Global Settings| C[Global Config]
    B -->|Applies Inhibition Rules| D[Inhibition Engine]
    B -->|Routes Alerts| E[Routing Tree]

    E -->|Matches Critical Alerts| F[discord_critical Receiver]
    E -->|Matches Warning Alerts| G[discord_warning Receiver]
    E -->|Matches Dev Alerts| H[discord_dev Receiver]
    E -->|Default| I[null Receiver]

    F -->|Sends Notifications| J[Discord Critical Channel]
    G -->|Sends Notifications| K[Discord Warning Channel]
    H -->|Sends Notifications| L[Discord Dev Channel]

    B -->|Formats Messages| M[Template Engine]

    classDef prod fill:#f9d5d3,stroke:#b22222,stroke-width:1px;
    classDef warn fill:#fef3c7,stroke:#b28d00,stroke-width:1px;
    classDef dev fill:#d3e5f9,stroke:#2155a4,stroke-width:1px;

    F,J prod
    G,K warn
    H,L dev

Summary

`config.yaml` is a critical configuration file for Alertmanager that:

This file plays a central role in the observability and incident response workflow by bridging metric-based alerting with team communication platforms.


Appendix: Key Terms

Term

Description

Alertmanager

Prometheus component responsible for alert routing and notifications.

Inhibition

Suppression of alerts based on the presence of others to reduce noise.

Receiver

Notification endpoint such as a Discord webhook.

Route

Configuration that defines alert filtering and routing logic.

Grouping

Combining alerts with similar labels into a single notification.

Matcher

Label-based condition used to filter alerts in routes and inhibition rules.

Webhook URL

URL endpoint used to send HTTP POST notifications to Discord.


This documentation should provide a comprehensive guide for understanding and maintaining the `config.yaml` Alertmanager configuration within the ShapeShift Unchained monitoring ecosystem.