AI· Case study 07
AI on-call triage agent
A production FastAPI service that classifies monitoring alerts with GPT-5 through the OpenAI API using structured outputs, then opens or updates tickets and Slack threads.
Auto-triage
alerts classified, deduplicated, and ticketed
Architecture at a glance
- Monitoring webhook
- FastAPI
- GPT-5 structured output
- Ticket + Slack
01 The problem
Alert noise and repeated failures ate on-call time. Every alert needed someone to open logs, classify the issue, and file or update a ticket. Volume is dozens to a few hundred alerts a day, so a hosted frontier model is cheap per alert, a dedicated GPU would sit idle, and a misclassified incident costs more than the API bill.
02 What I built
- 1A FastAPI service with authenticated webhook endpoints for monitoring alerts.
- 2Classification with GPT-5 through the OpenAI API. Logs are trimmed to recent and error lines and summarized before classifying, and secrets are redacted before anything is sent to the model.
- 3Structured outputs for issue category, likely cause, and severity. Each output is validated against a schema, retried, and falls back to “unknown, needs a human”.
- 4Prompt-injection containment. Logs are untrusted, so the model only classifies and cannot act outside the fixed ticket and Slack steps.
- 5Ticket automation that creates or updates issues only for persistent failures (for example, reconcile errors lasting more than 3 days) and avoids duplicates.
- 6Slack notifications with the diagnosis and next steps. Accuracy is checked by replaying past alerts with known causes, and engineers confirm the diagnosis in Slack.
- 7Containerized and deployed on Kubernetes with Helm.
03 Impact
Less manual triage, fewer duplicate tickets, and faster time to a first diagnosis for platform and customer-project failures. Engineers still confirm the diagnosis in Slack.