Skip to content
Novus Examples
yaml1.4 KB

Alertmanager Config — Routing Tree, Inhibition and Mute Windows (yaml)

An Alertmanager configuration with the routing behaviour that is hard to reason about without a fixture: a continue: true branch so a critical alert reaches two receivers, an inhibition rule suppressing warnings under a matching critical, and a weekend mute window.

Preview — first 50 linesyaml
# Alertmanager routing for the shop namespace. All receivers point at
# example.com endpoints that do not exist.
global:
  resolve_timeout: 5m
  smtp_from: alerts@example.com
  smtp_smarthost: smtp.example.net:587

route:
  receiver: platform-default
  group_by: [alertname, service]
  group_wait: 30s
  group_interval: 5m
  repeat_interval: 4h
  routes:
    - matchers:
        - severity = critical
      receiver: platform-oncall
      group_wait: 10s
      continue: true
    - matchers:
        - team = shop
        - severity =~ "warning|critical"
      receiver: shop-team
    - matchers:
        - alertname = TargetDown
      receiver: platform-default
      mute_time_intervals: [weekend-maintenance]

inhibit_rules:
  - source_matchers: [severity = critical]
    target_matchers: [severity = warning]
    equal: [alertname, service]

mute_time_intervals:
  - name: weekend-maintenance
    time_intervals:
      - weekdays: [saturday, sunday]
        times:
          - start_time: '02:00'
            end_time: '06:00'

receivers:
  - name: platform-default
    webhook_configs:
      - url: https://alerts.example.com/hooks/platform
        send_resolved: true
  - name: platform-oncall
    webhook_configs:
      - url: https://alerts.example.com/hooks/oncall
        send_resolved: true
56 lines total — download for the full file.

Specifications

Routes
4
Receivers
3
Inhibit Rules
1
Mute Time Intervals
1
Has Continue Route
true
Group By
alertname, service
Resolve Timeout
5m

Testing contract

Expected to pass
Scenario
Route a critical shop-team alert through this configuration.
Expected result
It reaches both platform-oncall and shop-team because the first matching route sets continue: true, and a matching warning on the same alertname and service is inhibited.

What is a .yaml file?

YAML (YAML Ain't Markup Language) is a human-readable data-serialization format using indentation, key-value pairs, and lists, and is a superset of JSON. It supports comments, anchors, and multiple documents per file, favoring readability for configuration. Its indentation sensitivity makes it error-prone to hand-edit.

How to use this file

Use an example YAML file to test config parsers, indentation and anchor handling, multi-document streams, and safe-loading to avoid arbitrary object construction.

How to use this file for testing

“Alertmanager Config — Routing Tree, Inhibition and Mute Windows (yaml)” is a deterministic Novus Examples fixture for Observability, Config parsing, Config testing. Structured and plain-text telemetry with known timestamps, levels, request identifiers, and error states for testing log ingestion, correlation, dashboards, and alert pipelines.

Documented properties for this file: YAML · 1,426 bytes. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Telemetry fixtures use fixed trace IDs, span IDs, and timestamps so ingestion is reproducible run to run. Point your collector, parser, or query layer at the file and assert the documented span tree, metric families, or severity mix; service and host names are invented.

Code examples

import yaml  # pip install pyyaml

with open("alertmanager-config.yaml") as f:
    data = yaml.safe_load(f)
print(data)

Generated by generation/observability.py. Free for any use, no attribution required — license.