دليل الاستجابة
Alertmanager مكتوم عالمياً
الأعراض
- لا تنبيهات في #ops-alerts منذ عدة ساعات رغم نمط حركة طبيعي.
- Prometheus يعرض alert state="firing" لكن Alertmanager لا يرسلها.
التحقق
check.sh
# Active silences (amtool is inside the container) docker exec via_prod-alertmanager amtool silence --alertmanager.url=http://localhost:9093 query # Anything firing but suppressed? curl -s http://localhost:9093/api/v2/alerts?silenced=true | jq '.[].labels' # Sanity: is Prometheus seeing rules at all? curl -s http://localhost:9090/api/v1/rules | jq '.data.groups[].rules[] | select(.state=="firing")'
المعالجة
- اعرض كل الصمتات واحذف ما انتهت نوافذه ولم تنتهِ صلاحيتها:expire.sh
# Expire a specific silence by ID docker exec via_prod-alertmanager amtool silence --alertmanager.url=http://localhost:9093 expire <silence-id> # Or nuke them all (use sparingly) for id in $(docker exec via_prod-alertmanager amtool silence --alertmanager.url=http://localhost:9093 query -q); do docker exec via_prod-alertmanager amtool silence --alertmanager.url=http://localhost:9093 expire "$id" done
- إذا لم تتلقَّ إشعارات: تحقق من صحة السلسلة — Slack webhook, PagerDuty integration key.
- أرسل تنبيه اختبار:test.sh
curl -X POST http://localhost:9093/api/v2/alerts -H 'Content-Type: application/json' -d '[{ "labels": {"alertname":"Heartbeat","severity":"warn"}, "annotations":{"summary":"runbook ping"} }]'
ما بعد الحادث
- حدد سياسة: كل صمت يجب أن يحمل ticket + expiry max 24h.
- أضف DeadMansSwitch يرسل ping كل 5 دقائق — إذا توقف، نعرف أن المسار متعطّل.