Real-time AI-powered log monitoring with FAISS and Groq AI
This project is a real-time Kubernetes anomaly detection dashboard that enables engineers to:
✅ Fetch logs from all Kubernetes pods dynamically
✅ Search logs instantly using FAISS
✅ Detect anomalies in real-time with AI
✅ Receive Slack alerts for critical issues
✅ Analyze logs with Groq AI for root cause suggestions
Stop manually searching through thousands of log lines! Use AI to debug Kubernetes efficiently.
- Fetches logs from all namespaces and pods dynamically.
- Stores logs as embeddings using FAISS for fast retrieval.
- Users can search logs instantly via a Streamlit UI.
- Uses Groq AI to detect anomalies and flag unusual log patterns.
- Provides AI-generated root cause analysis for Kubernetes errors.
- Slack notifications are sent for critical issues.
- Email alerts notify teams when anomalies are detected.
- View logs in real-time using Streamlit.
- Monitor error trends & anomalies.
- Filter logs by namespace, pod, or error type.
git clone https://github.com/stwins60/k8s-anomaly-detection.git
cd k8s-anomaly-detection
pip install -r requirements.txt
Create a .env
file in the root directory with the following variables:
GROQ_API_KEY=your_groq_api_key
GROQ_ENDPOINT=https://api.groq.com/v1/chat/completions
SLACK_WEBHOOK_URL=your_slack_webhook
EMAIL_ALERTS_ENABLED=True
SMTP_SERVER=smtp.example.com
SMTP_PORT=587
[email protected]
EMAIL_PASSWORD=your_email_password
[email protected]
- Start the Streamlit Dashboard
streamlit run app.py
- Open the Streamlit UI in your browser:
http://localhost:8501
- Fetch Kubernetes Logs
- The dashboard fetches logs from all pods and namespaces.
- Logs are stored as embeddings using FAISS for fast retrieval.
- Search Logs Instantly
- Users can search logs instantly using the Streamlit UI.
- FAISS retrieves logs with similar embeddings.
- AI-Powered Analysis
- AI detects unusual log patterns and provides root cause analysis.
- AI insights help engineers troubleshoot faster.
- Get Alerts for Critical Issues
- If an anomaly is detected, Slack alerts notify the team.
- Email alerts are sent for critical issues.