Team Ai
Apppublic

setumodi/devops-logs-analysis

sourceHugging Faceupdated 4mo agoView on Hugging Face
0likes
DevopsPrompt.md395 linesDownload Raw Back to root
1You are a Devops engineer with 20+ years of experience.2 3Design An app that lets users upload ops logs for live analysis.4Creates multiple agents:5Log reader/classifier agent (parses, categorizes, extracts fields).6Remediation agent (maps each detected issue to fixes/rationale).7Notification agent (pushes solutions directly to Slack channel).8Cookbook synthesizer agent (creates actionable checklists).9JIRA ticket agent (creates tickets for critical issues).10Orchestrator manages flow between agents using Langgraph.11Agents collaborate to reason over structured logs and recommend fixes, with traceable, actionable output via Slack/JIRA.12Why it's ideal:13Leverages multi-agent orchestration, automated remediation, and integrated notifications.14Perfect for DevOps, SRE, and incident management teams.15Demonstrates how GenAI/Agents can automate incident review, remediation mapping, and cross-tool notification—all in a scalable workflow.16 17 18------------19 20# Updated Architecture (Hugging Face Deployment)21 22```text23┌──────────────────────────────┐24│ Hugging Face Space           │25│ (Streamlit UI)               │26└──────────────┬───────────────┘27               │28               ▼29 30┌──────────────────────────────┐31│ LangGraph Orchestrator       │32│ Running inside HF Space      │33└──────┬───────────────────────┘34       │35       ▼36 37┌──────────────────────────────────────────┐38│ Multi-Agent Workflow                     │39├──────────────────────────────────────────┤40│ 1. Log Reader Agent                      │41│ 2. Classification Agent                  │42│ 3. Remediation Agent                     │43│ 4. Cookbook Agent                        │44│ 5. Jira Agent                            │45│ 6. Notification Agent                    │46└───────────────┬──────────────────────────┘47                │48                ▼49 50┌──────────────────────────────┐51│ Hugging Face Inference API   │52│ Llama / Mistral / Qwen       │53└──────────────────────────────┘54 55                │56                ▼57 58┌──────────────────────────────┐59│ Chroma Vector DB             │60│ Runbooks / Playbooks         │61└──────────────────────────────┘62 63                │64      ┌─────────┴──────────┐65      ▼                    ▼66 67   Slack                Jira68```69 70---71 72# Recommended Hugging Face Components73 74## UI Hosting75 76Use:77 78* [Hugging Face Spaces](https://huggingface.co/spaces?utm_source=chatgpt.com)79 80Advantages:81 82* Free tier available83* Streamlit supported84* Gradio supported85* Easy GitHub integration86* One-click deployment87 88---89 90## LLM Layer91 92Instead of OpenAI, use Hugging Face hosted models.93 94Recommended:95 96| Model       | Use Case          |97| ----------- | ----------------- |98| Qwen2.5     | Strong reasoning  |99| Llama 3     | General purpose   |100| Mistral     | Fast inference    |101| DeepSeek-R1 | Incident analysis |102 103Example:104 105```python106from langchain_huggingface import HuggingFaceEndpoint107 108llm = HuggingFaceEndpoint(109    repo_id="Qwen/Qwen2.5-72B-Instruct",110    temperature=0.2,111    huggingfacehub_api_token=HF_TOKEN112)113```114 115---116 117# Agent Architecture118 119## Agent 1 — Log Reader120 121### Input122 123```log124503 Service Unavailable125```126 127### Output128 129```json130{131  "service": "nginx",132  "severity": "critical",133  "error_type": "upstream_timeout"134}135```136 137No LLM required.138 139Use:140 141* Regex142* Grok parser143 144This reduces inference costs.145 146---147 148## Agent 2 — Incident Classifier149 150Uses HF model.151 152Prompt:153 154```text155Analyze the log.156 157Determine:158 159- Severity160- Probable root cause161- Confidence score162```163 164Output:165 166```json167{168  "root_cause":"pod_crashloop",169  "confidence":0.91170}171```172 173---174 175## Agent 3 — Remediation Agent176 177Uses RAG.178 179### Data Sources180 181Store:182 183```text184Kubernetes Runbooks185Nginx Runbooks186AWS Troubleshooting Guides187Internal SOPs188```189 190inside:191 192* ChromaDB193 194Workflow:195 196```text197Incident198      ↓199Embedding Search200      ↓201Top 5 Runbooks202      ↓203LLM Synthesis204```205 206---207 208## Agent 4 — Cookbook Generator209 210Produces:211 212```markdown213# Recovery Checklist214 2151. Verify pod health2162. Check OOMKilled events2173. Restart deployment2184. Validate recovery219```220 221Useful for junior engineers.222 223---224 225## Agent 5 — Jira Agent226 227Uses Jira REST API.228 229No LLM needed.230 231```python232jira.create_issue(...)233```234 235---236 237## Agent 6 — Slack Agent238 239Uses Slack SDK.240 241Posts:242 243```text244🚨 Critical Incident245 246Root Cause:247Backend pod crashloop248 249Suggested Fix:250Restart deployment251 252Jira:253OPS-341254```255 256---257 258# Updated LangGraph Flow259 260```text261START262  │263  ▼264 265Log Parser266 267  │268  ▼269 270Classifier Agent271 272  │273  ▼274 275Remediation Agent276(RAG)277 278  │279  ▼280 281Cookbook Agent282 283  │284  ▼285 286Critical?287 288 ┌─────YES─────┐289 ▼             ▼290 291Jira         Skip292 293 └─────┬───────┘294       ▼295 296Slack Agent297 298       ▼299 300END301```302 303---304 305# Folder Structure306 307```text308incident-analyzer/309│310├── app.py311│312├── agents/313│   ├── log_reader.py314│   ├── classifier.py315│   ├── remediation.py316│   ├── cookbook.py317│   ├── jira_agent.py318│   └── slack_agent.py319│320├── graph/321│   └── workflow.py322│323├── vectorstore/324│   ├── ingest.py325│   └── chroma_db/326│327├── prompts/328│329├── data/330│   └── runbooks/331│332├── requirements.txt333│334└── README.md335```336 337---338 339# Resume-Worthy Enhancements340 341To make this stand out even more:342 343### Add Observability Agent344 345Analyze:346 347* Kubernetes events348* Prometheus alerts349* Grafana alerts350 351### Add Similar Incident Search352 353```text354Current Incident355      ↓356Vector Search357      ↓358Past Incident #128359      ↓360Recommend Previous Fix361```362 363### Add Auto-Remediation364 365For low-risk actions:366 367```text368Restart Pod369Scale Deployment370Clear Queue371```372 373Require human approval before execution.374 375### Add Executive Summary Agent376 377Generate:378 379```text380Incident Summary381 382Duration: 14 min383Impact: 120 users384Root Cause: Pod crashloop385Resolution: Deployment restarted386```387 388---389 390For a portfolio project, I would position this as:391 392**"AI-Powered Multi-Agent DevOps Incident Analysis Platform using LangGraph, Hugging Face, ChromaDB, Slack, and Jira"**393 394This showcases AI engineering, DevOps, RAG, workflow orchestration, and cloud deployment in a single end-to-end solution.395