Files
openobserve/web
sktrpathiandsai nikhil kethe e52d000217 feat: add incident correlation system (#9507)
## Summary

Introduces comprehensive incident management system to reduce alert
fatigue through intelligent correlation and AI-powered root cause
analysis.

**Design at:**
https://github.com/openobserve/designs/tree/main/alert-correlation

---

## Incident Correlation

**3-Tier Correlation Priority:**
1. **Trace-based**: Groups alerts from same distributed trace
(cross-service)
2. **Service Discovery**: Uses semantic service matching with
normalization
3. **Dimension-based**: Blake3 hash from stable alert dimensions
(fallback)

**Features:**
- Automatic alert grouping into incidents
- Real-time incident status tracking
(open/acknowledged/resolved/suppressed)
- Topology enrichment via Service Graph integration
- Cross-environment correlation prevention via dimension matching

## Incident Analysis (RCA)

**Automated Analysis:**
- Background job queries open incidents and triggers AI agent
- Periodic analysis via configurable interval
- Results displayed in incident detail view with markdown support

**On-Demand Analysis:**
- Manual trigger via API: `POST /api/v2/{org}/alerts/incidents/{id}/rca`
- Real-time results with loading indicators
- One-click "Analyze" button in UI

## SRE Chat Assistant

**Conversational AI for Alerts:**
- Generic `/api/{org}/agent/chat` endpoint with history support
- Context-aware assistance for alerts and incidents
- Sparkle icons on alert/incident rows for quick access
- Persistent chat history via IndexedDB
- Includes RCA analysis in conversation context

---

## Configuration

```bash
# Incident Management
O2_INCIDENTS_AUTO_RESOLVE_AFTER_MINUTES=-1  # -1=disabled (default), >0=auto-resolve

# RCA Agent Integration
O2_INCIDENTS_RCA_ENABLED=true
O2_INCIDENTS_RCA_AGENT_URL=http://localhost:8000
O2_INCIDENTS_RCA_INTERVAL_SECS=600
```

## API Endpoints

- `GET /api/v2/{org}/alerts/incidents` - List incidents with pagination
- `GET /api/v2/{org}/alerts/incidents/{id}` - Get incident details
- `PATCH /api/v2/{org}/alerts/incidents/{id}` - Update incident status
- `GET /api/v2/{org}/alerts/incidents/stats` - Get incident statistics
- `POST /api/v2/{org}/alerts/incidents/{id}/rca` - Trigger RCA analysis
- `POST /api/{org}/agent/chat` - Generic agent chat endpoint
- `POST /api/{org}/agent/chat/stream` - Streaming agent chat

## Database

- **New tables**: `alert_incidents`, `alert_incident_alerts`
- **Migration**: `m20251204_000001_create_alert_incidents_table`
- **ORM**: SeaORM entities with full CRUD support

## UI Components

- **IncidentList.vue**: Status filtering, pagination, statistics
dashboard
- **IncidentDetailDrawer.vue**: Full incident view with
triggers/alerts/analysis
- **SREChat.vue**: AI assistant panel with markdown rendering
- Incidents tab in AlertList with unified view
- AI sparkle icons for contextual chat access

---

## Enterprise Feature

This is an **enterprise-only** feature with OSS stubs for compilation
compatibility.

- Non-enterprise builds: Handlers return `403 Forbidden`
- Enterprise builds: Full functionality enabled

## Test Plan

- [x] Build passes without `--features enterprise`
- [x] Build passes with `--features enterprise`
- [x] Create alerts that fire and verify incidents are created
- [x] Verify incident list/detail APIs work correctly
- [x] Verify status updates (open → acknowledged → resolved)
- [x] Verify correlation logic (trace-based, service discovery,
dimension-based)
- [x] Verify RCA analysis triggers and displays correctly
- [x] Verify SRE chat integration with alert/incident context

---------

Co-authored-by: sai nikhil kethe <nikhil@openobserve.ai>
2025-12-12 22:14:18 +05:30
..
2023-02-02 09:03:11 +05:30
2025-12-04 13:58:09 +05:30
2023-08-06 01:29:13 +08:00
2023-02-02 09:03:11 +05:30
2025-12-05 15:43:51 +05:30
2023-02-02 09:03:11 +05:30
2023-02-02 09:03:11 +05:30
2024-04-03 12:49:25 +05:30
2023-02-02 09:03:11 +05:30

web

This template should help get you started developing with Vue 3 in Vite.

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Type Support for .vue Imports in TS

TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Compile and Hot-Reload for Development

For stand-alone UI development environment, create .env file and which contains below environment variable

VITE_OPENOBSERVE_ENDPOINT=http://localhost:5080/
npm run dev

Type-Check, Compile and Minify for Production

npm run build

Run Unit Tests with Vitest

npm run test:unit

Run End-to-End Tests with Cypress

npm run test:e2e:dev

This runs the end-to-end tests against the Vite development server. It is much faster than the production build.

But it's still recommended to test the production build with test:e2e before deploying (e.g. in CI environments):

npm run build
npm run test:e2e

Lint with ESLint

npm run lint