Skip to content
🎉 Launch sale:50% off everything over $22 — automatically applied at checkout· ends Aug 2Shop the sale →
DevOps AI ToolKit
Newsletter
All prompts
AI for Prometheus & Monitoring Difficulty: Intermediate ClaudeCursor

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

More Prometheus & Monitoring prompts & error guides

Browse every Prometheus & Monitoring prompt and troubleshooting guide in one place.

Free download · 368-page PDF

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.