|
1 | 1 | # AI Log Summary: Turning Noise into Insights |
2 | 2 |
|
3 | 3 | **Project Status:** ✅ Operational |
4 | | -**Components:** Grafana Loki, Google Gemini 2.0 Flash, Home Assistant, Unraid, Python |
| 4 | +**Components:** Grafana, Loki, Promtail, Otel-Collector, Google Gemini 2.0 Flash, Home Assistant, Unraid, Python |
5 | 5 |
|
6 | 6 | ### 1. The Problem: Log Fatigue |
7 | 7 | In a distributed homelab (Unraid, Proxmox VE, Edge Servers, DNS (Adguard + Unbound), Traefik, Unifi Network, Tailscale ...), logs are scattered everywhere. |
@@ -30,47 +30,47 @@ Instead of feeding raw logs to an LLM (which is slow and expensive), I implement |
30 | 30 |
|
31 | 31 |
|
32 | 32 | ### 3. Architecture Diagram |
33 | | - |
34 | 33 | ```mermaid |
35 | 34 | graph TD |
36 | | - %% --- LEVEL 1: EDGE --- |
37 | | - subgraph Edge ["Edge Nodes (Collectors)"] |
| 35 | + %% --- LEVEL 1: SOURCES --- |
| 36 | + subgraph Sources ["Distributed Sources"] |
38 | 37 | direction TB |
39 | | - Docker[Docker Logs] & System[System Logs] --> Promtail[Promtail Agent] |
| 38 | + Edge[Edge Nodes] -->|Promtail| Loki |
| 39 | + Unifi[Unifi UDM Pro] -->|Syslog 5514| Otel |
| 40 | + PVE[Proxmox Nodes] -->|Syslog 5514| Otel |
| 41 | + UnraidD[Unraid Docker] -->|Filelog| Otel |
40 | 42 | end |
41 | 43 |
|
42 | | - %% --- LEVEL 2: UNRAID --- |
43 | | - subgraph Unraid ["Unraid Server (The Brain)"] |
| 44 | + %% --- LEVEL 2: PROCESSING --- |
| 45 | + subgraph Hub ["Unraid Hub (Processing)"] |
44 | 46 | direction TB |
45 | | - Promtail -->|Push| Loki[Loki DB] |
| 47 | + Otel[Otel Collector] -->|OTLP Push| Loki[Loki DB] |
46 | 48 | |
47 | | - %% The Fork: Human vs AI |
48 | | - Loki -->|Visualise| Grafana[Grafana UI] |
49 | 49 | Loki -->|Fetch| Script[Python Script] |
50 | | - |
| 50 | + Loki -->|Visualise| Grafana[Grafana UI] |
51 | 51 | Script <-->|Analyze| Gemini[Gemini API] |
52 | 52 | end |
53 | 53 |
|
54 | | - %% --- LEVEL 3: HA --- |
55 | | - subgraph HA ["Home Assistant (Interface)"] |
| 54 | + %% --- LEVEL 3: INTERFACE --- |
| 55 | + subgraph HA ["Home Assistant"] |
56 | 56 | direction TB |
57 | 57 | Script -->|Webhook| Core[Home Assistant] |
58 | 58 | Core --> Phone[Mobile Alert] |
59 | 59 | Core --> Wall[Dashboard] |
60 | 60 | end |
61 | 61 |
|
62 | | - %% --- THE FIX: INVISIBLE STRUT --- |
| 62 | + %% --- THE FIX: INVISIBLE STRUT --- |
63 | 63 | %% Forces HA to stay at the bottom |
64 | 64 | Gemini ~~~ Core |
65 | 65 |
|
66 | | - %% --- STYLING --- |
| 66 | + style Otel fill:#ff9900,stroke:#333,stroke-width:2px,color:white |
67 | 67 | style Loki fill:#f9f,stroke:#333,stroke-width:2px |
68 | 68 | style Script fill:#ff9,stroke:#333,stroke-width:2px |
69 | | - style Gemini fill:#4285f4,stroke:#fff,stroke-width:2px,color:#fff |
70 | | - style Grafana fill:#ff9900,stroke:#333,stroke-width:2px,color:white |
71 | 69 | ``` |
72 | 70 |
|
73 | | -*Logs are aggregated from distributed collectors via Promtail and centralized in a Loki instance on Unraid. This data feeds two parallel consumers: Grafana for visualization and a Python-based automation loop. The Python script queries Loki, processes logs through Google Gemini for anomaly detection, and forwards actionable insights to Home Assistant via Webhooks.* |
| 71 | + |
| 72 | + |
| 73 | +*Logs are aggregated from distributed collectors via Promtail and Otel-Collector and centralized in a Loki instance on Unraid. This data feeds two parallel consumers: Grafana for visualization and a Python-based automation loop. The Python script queries Loki, processes logs through Google Gemini for anomaly detection, and forwards actionable insights to Home Assistant via Webhooks.* |
74 | 74 |
|
75 | 75 |
|
76 | 76 | ### 4. Key Features |
|
0 commit comments