SentinelOps is a real-time incident management system built with FastAPI, providing RESTful APIs and WebSocket support for monitoring and managing incidents.
- Incident creation, retrieval, and management
- Real-time updates via WebSocket
- RESTful API endpoints
- Database integration with SQLAlchemy
- Pydantic models for data validation
- Asynchronous operations with FastAPI
- AI-Powered Incident Analysis - Uses Google Gemini via
google-genaito analyze logs and metrics for intelligent root cause analysis
-
Clone the repository:
git clone <repository-url> cd SentinelOps
-
Create and activate a virtual environment:
python -m venv env env\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables: Create a
.envfile in the root directory:GEMINI_API_KEY=your_gemini_api_key_here LLM_PROVIDER=gemini GEMINI_MODEL=gemini-3-flash-preview
Start the server with auto-reload:
uvicorn app.main:app --reloadThe application will be available at http://localhost:8000
Once the server is running, visit http://localhost:8000/docs for interactive API documentation powered by Swagger UI.
Real-time incident updates are available via WebSocket at ws://localhost:8000/ws/incidents
SentinelOps includes AI-powered incident analysis that can:
- Analyze system logs and metrics
- Identify potential root causes
- Provide recommended actions
- Assess incident severity
- Generate confidence scores
- Automatic Analysis: Incidents created by the monitoring simulator automatically trigger AI analysis
- Manual Analysis: Use the
/incidents/analyzeendpoint to analyze specific logs and metrics
Example API call:
curl -X POST "http://localhost:8000/incidents/analyze" \
-H "Content-Type: application/json" \
-d '{
"logs": "[2024-01-15 10:30:45] ERROR redis: Connection timeout",
"metrics": {
"cpu_usage": 95,
"memory_usage": 88,
"api_error_rate": 0.15,
"db_latency_ms": 2500
}
}'app/main.py: FastAPI application entry pointapp/api/: API route handlersapp/core/: Core functionality (database, etc.)app/models/: Database modelsapp/schemas/: Pydantic schemasapp/services/: Business logic servicesapp/websocket/: WebSocket handlers
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License.