prometheus-runbooks
БесплатноЗапускает вложенные скриптыНе проверенRead active Prometheus alerts and propose concrete runbook remediation steps for each firing alert. Use when the user runs /prometheus-runbooks or asks to…
от diegopacheco★ 21 звезда на GitHubОб этом скилле
Prometheus Runbooks
When invoked, you read the active alerts from a Prometheus server, then for every firing alert you propose a concrete runbook: the most likely cause, the ordered steps to investigate and remediate, how to verify the fix, and when to escalate. The skill is generic: it works against any Prometheus instance and any alert names, using the alert labels and annotations plus the pattern library below.
Global Context
- User request / scope: $ARGUMENTS — empty, or a Prometheus base URL (for example
http://localhost:9090), optionally followed by an alert name to focus on. - Engine:
scripts/fetch_alerts.py(Python standard library only, no third-party dependencies). - Default Prometheus URL:
http://localhost:9090, overridable by the first argument or thePROMETHEUS_URLenvironment variable. - Output: a runbook proposal printed to the user. Nothing is written to disk and nothing is changed on the Prometheus server.
Rules
- The alert data comes only from the Prometheus HTTP API (
/api/v1/alerts). Never invent alert names, label values, or$valuenumbers — read them from the script output. - Read-only against the monitored systems. You only fetch alerts; you never silence, delete, or modify alerts, and you never run remediation commands yourself. You propose steps for a human to run.
- A proposed runbook step is a suggestion, not a guarantee. Always tell the user to confirm the cause before acting on production.
- Do not add comments to any command you run.
Steps
Resolve the Prometheus URL. Use, in order: the first word of $ARGUMENTS if it looks like a URL, then
$PROMETHEUS_URL, thenhttp://localhost:9090. If a second word is present treat it as an alert name to focus on.Fetch the active alerts:
python3 scripts/fetch_alerts.py <prometheus-url>The script prints a JSON array. Each item has
name,state(firingorpending),severity,labels,annotations,activeAt, andvalue.If the script fails to connect, stop and tell the user the URL it tried and that the Prometheus server is unreachable. Do not fabricate alerts.
Filter to
state == "firing"(mention pending alerts only as a heads-up). If an alert name was given in $ARGUMENTS, keep only that alert. If there are zero firing alerts, say so plainly and stop.For each firing alert, build a runbook proposal:
- Read the alert
annotations. If arunbook_urlannotation exists, surface it first — it is the team's own runbook and takes priority over the generic library. - Match the alert against the Pattern Library below by
alertname, then byseverityand by the metric referenced in thesummary/descriptionannotations. Matching is fuzzy:HighErrorRate,ErrorBudgetBurn, and5xxTooHighall map to the Errors pattern. - If nothing matches, fall back to the Unknown Alert procedure.
- Read the alert
Present the result using the Output Format. Order alerts by severity:
criticalfirst, thenwarning, then everything else.
Pattern Library
Map the alert to one category, then propose the matching steps. Adapt the steps to the alert's labels (use the real instance, job, namespace, pod, etc.).
Availability — target / instance down
Signals: up == 0, InstanceDown, TargetDown, TargetMissing, KubePodNotReady, probe failures.
Proposed steps:
- Confirm the target is really down vs. a scrape problem: open
http://<prometheus>/targetsand check the endpoint's last error. - Reach the instance directly (
curlits metrics or health endpoint;ping/telnetthe host:port). - Check the process/pod state on the host (
systemctl status <svc>,podman ps,kubectl get pod <pod> -n <ns>). - Check for resource exhaustion that killed it (OOM in
dmesg/kubectl describe pod, disk full). - Restart the service/pod if the cause is a crash; capture logs first.
Verify: the target returns to
up == 1and the alert clears.
Errors — high error / failure rate
Signals: HighErrorRate, 5xx, ErrorBudgetBurn, app_error_rate, error ratios above threshold.
Proposed steps:
- Correlate with recent changes: was there a deploy/config change in the alert's window (
activeAt)? If yes, consider rollback. - Read the service logs filtered to errors for the affected
instance/job. - Check the health of downstream dependencies (DB, cache, upstream APIs) — a dependency failure shows as your errors.
- Check whether errors are uniform or isolated to one instance/region (label breakdown).
- Mitigate: roll back the suspect deploy, or shed/route traffic away from the bad instance.
Verify: error ratio drops below threshold for the alert's
forduration.
Saturation (CPU) — high CPU / load
Signals: HighCPU, CPUThrottlingHigh, load average alerts.
Proposed steps:
- Identify the hot process (
top/htop,kubectl top pod). - Decide runaway vs. genuine load: check request rate alongside CPU.
- If genuine load: scale out (add replicas) or scale up (
Установить prometheus-runbooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashReadAskUserQuestionВложенные файлы
FAQ
Что делает скилл prometheus-runbooks?
Read active Prometheus alerts and propose concrete runbook remediation steps for each firing alert. Use when the user runs /prometheus-runbooks or asks to triage Prometheus or Alertmanager alerts, investigate firing alerts, explain what an alert means, or generate a runbook for an alert.
Как установить скилл prometheus-runbooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл prometheus-runbooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
agent-skill-stack
Find, evaluate, and assemble the smallest compatible set of AI Agent Skills for an end-to-end natural-language goal. Use when a user wants Skills for a…
от GitHubbuild-evidence-map
Build an auditable evidence map for a contested technical choice, research synthesis, proposal review, or consequential decision. Use when Copilot must…
от GitHubpinecone-rag
Build production RAG pipelines and persistent agent memory using Pinecone as the vector database backend. ALWAYS USE THIS SKILL when the user mentions…
от GitHubqdrant-monitoring-debugging
Diagnoses Qdrant production issues using metrics and observability tools. Use when someone reports 'optimizer stuck', 'indexing too slow', 'memory too high'…
от GitHub