AIOps: AI for IT Operations · Module 05
LLMs for Operations
Where language models help an on-call engineer: summarising logs and traces with redaction, answering from runbooks and postmortems, writing PromQL and LogQL that is checked before it runs, and keeping answers honest.
Học xong bạn làm được
- Summarise logs and traces with an LLM, redacted and with evidence
- Answer from runbooks and postmortems with RAG
- Turn a question into PromQL or LogQL and validate it against the real metric and label names
- Reduce hallucination in operational answers
Bài học
- Summarising logs and traces
An LLM can turn thousands of log lines and spans into a short incident summary, but only with preparation - redact first, compress logs into templates with counts, chunk what is left to fit a token budget, number every line, and require the summary to cite the line numbers it relies on so a person can check each claim.
- RAG over runbooks and postmortems
Runbooks and postmortems hold what the team already knows, and retrieval-augmented generation puts the right part of them in front of a model. Index them by section with metadata (service, owner, updated date), retrieve with the incident's own words and service, prefer fresh documents and flag stale ones, and make the answer cite the runbook step it follows.
- Text to PromQL and LogQL
A model can turn "how many checkout requests failed in the last 10 minutes?" into PromQL or LogQL, but only reliably with the real schema in the prompt (metric and label names from the APIs), a few worked examples, and checks before anything runs - every name must exist, the query must parse (format_query), and it must be bounded in time range, step and result size.
- Keeping answers honest
In operations a confident wrong answer costs more than no answer. Ground every claim in evidence the system retrieved, make "I don't know" a valid, rewarded answer, attach a link to every query, log line and runbook step used, check those links in code, and keep the assistant read-only by default so that a wrong answer cannot become a wrong action.