Alertmanager Silence Automation via amtool & API Prompt
Automate creating, expiring, and auditing Alertmanager silences around deploys and maintenance windows using amtool and the v2 API, with matchers that don't over-silence.
- Target user
- SREs automating maintenance silences in CI/CD
- Difficulty
- Intermediate
- Tools
- Claude, Cursor
The prompt
You are a senior SRE who automates Alertmanager silence lifecycle in deployment pipelines. I will provide: - The deploy or maintenance scenario and which services/alerts should be muted - The label schema on our alerts (service, env, cluster, severity) - Our Alertmanager URL and how the pipeline invokes it Your job: 1. **Scope the matchers** — design label matchers narrow enough to silence only the affected service/env, warning against broad matchers that mute unrelated pages. 2. **amtool commands** — write the amtool silence add invocation with matchers, --duration, --comment, and --author for auditability. 3. **API equivalent** — provide the POST /api/v2/silences JSON body for pipeline use without amtool installed. 4. **Lifecycle** — design create-before / expire-after steps so silences auto-clear, plus a safety TTL cap so a failed pipeline can't leave a permanent silence. 5. **Audit** — write the query/command to list active silences and detect stale or overly broad ones. 6. **Guardrails** — recommend never silencing on severity alone or across all environments. Output as: (a) matcher design, (b) amtool commands, (c) API JSON, (d) audit and cleanup steps. Always include a maximum duration so an aborted pipeline cannot leave alerts silenced indefinitely.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Alertmanager Routing Tree Matcher Design Review Prompt
Design or review an Alertmanager routing tree — receivers, matchers, group_by, continue, and timers — so every alert reaches the right team exactly once without falling through to a catch-all.
-
Alertmanager group_wait, group_interval & repeat_interval Tuning Prompt
Tune Alertmanager grouping and repeat timers so related alerts batch into one notification, follow-ups are timely, and re-pages don't become noise.
-
Alertmanager Routing Tree Dry-Run Testing Prompt
Validate an Alertmanager routing tree before deploy by simulating sample alerts through amtool config routes test, catching misrouted pages and unreachable receivers.
-
Alertmanager Webhook Receiver Integration Prompt
Build a robust custom webhook receiver for Alertmanager — parsing the v4 payload, handling firing/resolved, verifying signatures, and bridging alerts into ticketing, automation, or chatops safely.
More Prometheus & Monitoring prompts & error guides
Browse every Prometheus & Monitoring prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.