Skip to content

Prometheus Alertmanager Inhibition Rules Not Working Fix

DodaTech Updated 2026-06-24 3 min read

In this tutorial, you'll learn about Prometheus Alertmanager Inhibition Rules Not Working Fix. We cover key concepts, practical examples, and best practices.

Your Alertmanager inhibition rules do not suppress lower-severity alerts — DatacenterDown fires but HostDown and ServiceDown alerts still notify. Inhibition rules must match labels between the source and target alerts exactly.

The Problem

inhibit_rules:
  - source_match:
      alertname: DatacenterDown
    target_match:
      alertname: HostDown
    equal: ['datacenter']

The HostDown alert does not have a datacenter label, or the value does not match the DatacenterDown alert's datacenter label. The inhibition rule requires the equal labels to have matching values.

Step-by-Step Fix

1. Ensure target alerts have matching labels

# Source alert
alert: DatacenterDown
expr: ...
labels:
  severity: critical
  datacenter: us-east-1

# Target alert (must have the same datacenter label)
alert: HostDown
expr: ...
labels:
  severity: warning
  datacenter: us-east-1  # Must match source

2. Configure inhibition rules correctly

inhibit_rules:
  # High-severity inhibition
  - source_match:
      severity: critical
    target_match:
      severity: warning
    equal: ['datacenter']

  # Specific inhibition
  - source_match:
      alertname: DatacenterDown
    target_match:
      alertname: HostDown
    equal: ['datacenter']

  # Global inhibition (no equal labels)
  - source_match:
      alertname: Watchdog
    target_match:
      severity: critical
    # No equal — inhibits ALL critical alerts when Watchdog fires
    # (Watchdog fires indicate Alertmanager is working)

3. Use regex matching for target alerts

inhibit_rules:
  # Inhibit all alerts with severity=warning or severity=info
  # when any alert with severity=critical fires
  - source_match:
      severity: critical
    target_match_re:
      severity: 'warning|info'
    equal: ['datacenter', 'service']

4. Test inhibition rules

# Use amtool to test inhibition
amtool config routes --alertmanager.url=http://localhost:9093

# Simulate alerts
amtool alert add \
  --alertmanager.url=http://localhost:9093 \
  DatacenterDown severity=critical datacenter=us-east-1

# Check inhibited alerts
amtool alert query \
  --alertmanager.url=http://localhost:9093 \
  --inhibited

5. Debug with Alertmanager UI

# Open Alertmanager UI
# http://localhost:9093

# Check Silences & Inhibitions section
# See which alerts are inhibited and by which source

Expected output:

Active alerts:
  DatacenterDown (critical) — FIRING
  HostDown (warning) — INHIBITED by DatacenterDown
  ServiceDown (warning) — INHIBITED by DatacenterDown
  DiskUsage (warning) — FIRING (different service, not inhibited)

Prevention Tips

  • Ensure equal labels exist on both source and target alerts
  • Use severity for broad inhibition (critical inhibits warning)
  • Use alertname for specific alert-to-alert inhibition
  • Test inhibition with amtool before deploying
  • Document inhibition rules in your runbook

Common Mistakes with alertmanager inhibit

  1. Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks
  2. Using return to exit a function early instead of wrapping a pure value in the monad
  3. Mixing let bindings with <- bindings in do notation, producing type errors

These mistakes appear frequently in real-world PROMETHEUS code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

### What happens if source and target have different label values?

The inhibition rule is ignored if any label in equal has a different value between source and target. For example, DatacenterDown{datacenter=us-east-1} does NOT inhibit HostDown{datacenter=eu-west-1} because the datacenter values differ.

Can I inhibit alerts across different routes?

Yes, inhibition works globally across all routes and receivers in Alertmanager. If a source alert matches the inhibition rule, all matching target alerts are suppressed regardless of their routing configuration.

How do I inhibit alerts from different namespaces?

Add a namespace label to your alerts and include it in equal. For example: source_match: { alertname: ClusterDown } with equal: [namespace]. Alert ClusterDown{namespace=prod} inhibits alerts with namespace=prod.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro