{"id":26678292,"url":"https://github.com/telexintegrations/ai-powered-log-formatter-and-debugger","last_synced_at":"2025-03-26T05:15:24.496Z","repository":{"id":278939970,"uuid":"937226748","full_name":"telexintegrations/AI-Powered-Log-Formatter-and-Debugger","owner":"telexintegrations","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-22T17:17:09.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-22T17:33:26.455Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/telexintegrations.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-22T16:30:14.000Z","updated_at":"2025-02-22T17:17:12.000Z","dependencies_parsed_at":"2025-02-22T17:43:29.816Z","dependency_job_id":null,"html_url":"https://github.com/telexintegrations/AI-Powered-Log-Formatter-and-Debugger","commit_stats":null,"previous_names":["telexintegrations/ai-powered-log-formatter-and-debugger"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2FAI-Powered-Log-Formatter-and-Debugger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2FAI-Powered-Log-Formatter-and-Debugger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2FAI-Powered-Log-Formatter-and-Debugger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/telexintegrations%2FAI-Powered-Log-Formatter-and-Debugger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/telexintegrations","download_url":"https://codeload.github.com/telexintegrations/AI-Powered-Log-Formatter-and-Debugger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245591533,"owners_count":20640692,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-26T05:15:23.855Z","updated_at":"2025-03-26T05:15:24.478Z","avatar_url":"https://github.com/telexintegrations.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Log Analyzer\n\n## 📌 Overview\n**AI Log Analyzer** is an AI-powered log analysis service that categorizes logs, detects errors, and provides AI-generated suggestions for resolving issues. The system integrates with **Telex** for real-time log monitoring and supports **Slack notifications** for critical alerts.\n\n## 🚀 Features\n- **Real-time Log Processing**: Captures and analyzes logs as they are received.\n- **AI-Powered Error Analysis**: Uses AI models OpenAI GPT-4 to detect errors and suggest fixes.\n- **Log Categorization**: Automatically classifies logs into `INFO`, `WARNING`, and `ERROR`.\n- **Slack Integration**: Sends alerts to Slack channels for quick issue resolution.\n- **Database Storage**: Logs are stored for historical analysis and debugging.\n\n## 🏗️ Architecture\n1. **Receives logs** from Telex.\n2. **Categorizes logs** into INFO, WARNING, or ERROR.\n3. If enabled, **AI analyzes errors** and suggests solutions.\n4. Optionally **sends alerts to Slack** for critical logs.\n5. **Stores logs in a database** for later review.\n\n## 📡 API Endpoints\n### **Log Processing Endpoint**\n```http\nPOST /telex/logs\n```\n#### **Request Body**\n```json\n{\n  \"message\": \"Application error: Database connection failed\",\n  \"settings\": [\n    {\"label\": \"Enable AI Analysis\", \"value\": \"Yes\"},\n    {\"label\": \"Send Alerts to Slack\", \"value\": \"Yes\"},\n    {\"label\": \"Send Alerts to Telex\", \"value\": \"Yes\"} \n  ]\n}\n\n```\n#### **Response**\n```json\n{\n  \"original_message\": \"Database connection failed: timeout error\",\n  \"category\": \"ERROR\",\n  \"ai_suggestion\": \"Try increasing the database connection timeout setting and check network latency.\",\n  \"processed_at\": \"2025-02-21T12:34:56Z\"\n}\n```\n\n## 🔧 Installation \u0026 Setup\n### **1️⃣ Clone the Repository**\n```bash\ngit clone https://github.com/telexintegrations/AI-Powered-Log-Formatter-and-Debugger.git\ncd AI-Powered-Log-Formatter-and-Debugger\n```\n### **2️⃣ Create a Virtual Environment \u0026 Install Dependencies**\n```bash\npython -m venv venv\nsource venv/bin/activate  \npip install -r requirements.txt\n```\n### **3️⃣ Set Up Environment Variables**\nCreate a `.env` file and configure:\n```env\nSLACK_WEBHOOK_URL=https://hooks.slack.com/services/...\nAI_MODEL_TYPE=OpenAI_GPT-4 \nDATABASE_URL=postgresql://user:password@localhost/logs_db\n```\n### **4️⃣ Run the FastAPI Server**\n```bash\nuvicorn main:app --reload\n```\n\n## 📦 Deployment\nTo deploy on a cloud provider (e.g., **AWS, GCP, DigitalOcean, Render**):\n1. **Containerize** the app using Docker.\n2. Deploy using a service like **Kubernetes, AWS ECS, or DigitalOcean App Platform**.\n3. Set up **CI/CD** for automatic deployments.\n\n## 📊 Telex Integration Setup\n1. **Log into Telex** and go to **Integrations \u003e Create New Integration**.\n2. Upload the `integration.json` specification (found in the repo).\n3. Set `target_url` to your FastAPI endpoint (e.g., `https://AI-service.render.com/telex/logs`).\n4. Save and enable the integration.\n\n## 🛠️ Technologies Used\n- **FastAPI** - Backend API framework\n- **PostgreSQL** - Log storage database\n- **OpenAI GPT-4** - AI-powered log analysis\n- **Slack API** - Log alert notifications\n- **Docker** - Containerization\n- **Telex** - Log streaming and event handling\n\n## 👥 Contributors\n- **[Breeze Concept](https://github.com/breezeconcept)** - Lead Developer\n\n## 📄 License\nThis project is licensed under the **MIT License**. See [LICENSE](LICENSE) for more details.\n\n---\n💡 **Have suggestions or want to contribute?** Open an issue or submit a pull request!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelexintegrations%2Fai-powered-log-formatter-and-debugger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelexintegrations%2Fai-powered-log-formatter-and-debugger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelexintegrations%2Fai-powered-log-formatter-and-debugger/lists"}