Skip to content

sadiq-git/remediator

Repository files navigation

Prometheus → AIMLAPI → Auto‑Remediation (Starter Pack)

This starter replaces Gemini with AIMLAPI (OpenAI‑compatible) using the openai SDK pointed at https://api.aimlapi.com/v1. It receives Prometheus Alertmanager webhooks, asks an LLM to propose a strict JSON remediation plan, persists it, and offers a stub executor with dry‑run + approval gates.

Quick start

cd aimlapi-remediator
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cp .env .env.local  # (optional) keep your edits separate
# or edit .env directly to set AIMLAPI_API_KEY and others
python app.py
curl localhost:8080/health

Docker

docker build -t aimlapi-remediator:local .
docker run --rm -p 8080:8080 --env-file .env aimlapi-remediator:local

Kubernetes (manifests/k8s.yaml)

kubectl apply -f manifests/k8s.yaml

Send a synthetic alert

curl -s localhost:8080/alert -H 'Content-Type: application/json' -d @sample_alert.json | jq .

Execute (dry‑run by default)

PLAN_ID=$(curl -s localhost:8080/alert -H 'Content-Type: application/json' -d @sample_alert.json | jq -r '.plans[0].plan_id')
curl -s localhost:8080/execute -H 'Content-Type: application/json' -d '{"plan_id":"'"$PLAN_ID"'","dry_run":true}' | jq .

Notes

  • Keep .env out of git; it contains secrets.
  • Adjust AIMLAPI_MODEL to any supported chat model (e.g., gpt-4o, deepseek-chat, etc.).
  • The executor is stubbed—wire real k8s/ECS actions cautiously behind allowlists + approvals.
  • Exposes Prometheus metrics at /metrics for visibility.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published