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.
- Target user
- Engineers integrating Alertmanager with tools that lack a native receiver
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a platform engineer who has built bulletproof webhook bridges between Alertmanager and systems that have no native receiver (Jira, ServiceNow, a runbook automation engine, an internal bot). I will provide: - The downstream system and its API - My Alertmanager version and route config - The transformation I need (create ticket, trigger automation, post to chatops) - Reliability/security constraints Your job: 1. **The payload contract** — document the Alertmanager webhook JSON (`version: "4"`): top-level `status`, `groupKey`, `commonLabels`, `commonAnnotations`, and the `alerts[]` array each with its own `status` (firing/resolved), `labels`, `annotations`, `startsAt`, `endsAt`, `generatorURL`, and `fingerprint`. Call out that ONE webhook call can carry MANY grouped alerts. 2. **Idempotency** — use `fingerprint` (and `groupKey`) as the dedup/correlation key so a re-sent group doesn't create duplicate tickets. Show the firing→resolved lifecycle: open on firing, close/comment on resolved, keyed by fingerprint. 3. **Reliability** — Alertmanager retries on non-2xx, so the receiver MUST be idempotent and fast. Recommend: ack quickly (202), do downstream work async via a queue, set sane timeouts, and never block Alertmanager's send loop. Handle the thundering-herd of a big group. 4. **Security** — Alertmanager webhooks have no built-in signing, so put auth in front: mTLS, a shared bearer token via `http_config.authorization`, or a reverse-proxy allowlist. Never expose the receiver publicly unauthenticated. 5. **Mapping** — translate labels/annotations into the downstream schema (severity → priority, `summary` → title, `runbook_url` → linked field). Provide a defaulting strategy for missing fields and a validation step that rejects malformed alerts loudly. 6. **Routing** — the Alertmanager `webhook_config` and the route that sends only the right alerts here (avoid firehosing every alert into a ticket system). 7. **Validate** — replay a sample firing + resolved payload through the receiver and assert exactly one ticket opened and one closed. Output: the receiver pseudocode/handler, the Alertmanager `webhook_config` + route, the label→downstream mapping table, and the idempotency/retry design.
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 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.
-
Alertmanager PagerDuty Receiver Integration Prompt
Wire Prometheus Alertmanager to PagerDuty with correct severity mapping, dedup keys, custom details, and auto-resolve so on-call pages are actionable and noise-free.
-
Alertmanager HA Cluster & Gossip Mesh Design Prompt
Design and debug a highly available Alertmanager cluster — gossip mesh, notification deduplication across replicas, and split-brain avoidance — so alerts fire exactly once during failures.
-
Alertmanager Time Intervals & Mute Schedules Prompt
Design business-hours routing, maintenance-window muting, and follow-the-sun on-call handoffs in Alertmanager using time_intervals, mute_time_intervals, and active_time_intervals — without dropping real pages.
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.