When an incident reachesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/nicolas344/Sentinel-SoftServe/llms.txt
Use this file to discover all available pages before exploring further.
resolved status, Sentinel automatically generates a structured post-mortem document using GPT-4o-mini. The generation happens asynchronously as a FastAPI BackgroundTask so it never blocks the status update that the frontend receives in real time. Engineers can then review, edit, and export the post-mortem directly from the dashboard’s Post-Mortem tab.
Generation Lifecycle
Incident resolves
The verification service confirms the affected resource is healthy and sets
status = 'resolved', writing the resolved_at timestamp. The MTTR is computed as resolved_at - created_at and formatted as a human-readable string (e.g., 4m 32s, 1h 12m).BackgroundTask triggers
The FastAPI route handler schedules post-mortem generation as a background task immediately after committing the status update. This is non-blocking — the HTTP response is already on its way to the frontend before the LLM call starts.
LLM generates the document
GPT-4o-mini receives the full incident context as a JSON prompt:
title,severity,target,source_type- Container or query
logs(truncated to 2,500 chars) agent_reasoning(full investigation Markdown, truncated to 3,500 chars)- Status
timelineextracted fromincident_events action_resultandaction_error- Computed MTTR
Engineer reviews in the Post-Mortem tab
The
PostMortemEditor component fetches the content via GET /api/incidents/{id}/post-mortem when the Post-Mortem tab is first opened. The content appears in a full-height Markdown textarea. The last-updated timestamp and character count are shown in the header.Edit if needed
The textarea is fully editable. Engineers can correct inaccuracies, add context, rewrite the lessons-learned section, or attach links to follow-up tickets. All edits are local until saved.
Post-Mortem Structure
The LLM is prompted to produce a Markdown document using the following fixed sections (defined inservices/postmortem/template.py):
| Section | Contents |
|---|---|
| Summary | A concise description of the incident drawn from logs and agent reasoning |
| Root Cause | The agent’s diagnosis of the underlying failure |
| Timeline | Chronological status transitions sourced from incident_events |
| Resolution | The exact command executed and its output, or the manual resolution applied |
| MTTR | resolved_at - created_at formatted as a human-readable duration |
| Lessons Learned | Observations and recommendations to improve observability and runbooks |
| Preventive Actions | Concrete steps (alerts, capacity review, runbook updates) to avoid recurrence |
The PostMortemEditor Component
ThePostMortemEditor renders only when incident.status === 'resolved'. For incidents still in progress it shows a message explaining that the post-mortem will be generated automatically upon resolution.
- Last updated — formatted date/time of the most recent save
- Character count — locale-formatted length of the current content
- Export .md button — triggers a browser download of the raw Markdown
- Save button — disabled while loading, while saving, or if the content is empty
API Reference
| Method | Endpoint | Description |
|---|---|---|
GET | /api/incidents/{id}/post-mortem | Fetch the post-mortem. Re-generates if content is empty. |
PUT | /api/incidents/{id}/post-mortem | Save edited content. Body: { "content": "..." } |
Authorization header. The PUT response includes an updated_at timestamp that the PostMortemEditor uses to refresh the header metadata without a full reload.
ChromaDB Storage
After a post-mortem is generated, Sentinel stores the full incident record (includingagent_reasoning, proposed_action, and the post-mortem text) in ChromaDB under the incidents-{domain} collection. This enables the SimilarIncidentsCard to surface this incident when future incidents with similar patterns are investigated — closing the learning loop across incidents.
Export via ExportModal
The Export Incident button (accessible from the detail panel header) opens theExportModal, which includes the complete post-mortem content in both the JSON and Markdown export formats. This makes it easy to attach post-mortems to tickets, share them in Slack, or archive them in a runbook repository.