How peviss/smartlog-analyzer works
SmartLog Analyzer centralizes ECS-formatted microservice logs, supports ingestion, search and statistics, and produces AI summaries, problem categories, and suggested actions. Users move through the React UI to a FastAPI endpoint; log ingestion validates and stores documents, while analysis preprocesses matching logs and invokes a configurable LLM. The README documents mock and hosted/local providers. Some backend handlers and analysis modules were not excerpted, so their internal call relationships are shown only where the README or indexed references support them.
Main entry points: pages Product views · main.py FastAPI application · analysis.py Analysis service · ingestion.py Ingestion service
Components 24
Web interface
- App shell
src/frontend/src/App.tsx - Product views
src/frontend/src/pages - Typed API client
src/frontend/src/api/client.ts - Shared filters
src/frontend/src/lib/filters.ts - Ingest interface
src/frontend/src/pages/IngestPage.tsx - File import
src/frontend/src/components/ImportPanel.tsx - Result display
src/frontend/src/components/IngestResults.tsx - Recent analyses
src/frontend/src/lib/storage.ts
API and use cases
- FastAPI application
src/api/main.py - Log endpoints
src/api/routers/logs.py - Analysis endpoints
src/api/routers/analysis.py - Health endpoint
src/api/routers/health.py - Ingestion service
src/api/services/ingestion.py
Log domain
- Raw log import
src/api/domain/raw_logs - ECS mapping
src/api/domain/ecs.py - Log validation
src/api/schemas/logs.py
Persistence
- Log repository
src/api/repositories/logs.py - PostgreSQL
- Log and analysis tables
src/api/database/tables.py
Analysis and AI
- Analysis service
src/api/services/analysis.py - Pattern extraction
src/api/domain/patterns.py - Typed LLM agent
src/api/llm/agent.py - LLM providers
src/api/llm/providers.py
Other components
- Operator
Connections 27
- Operator → App shell: uses
README.md - App shell → Product views: renders
src/frontend/src/App.tsx - App shell → Shared filters: shares filters
src/frontend/src/App.tsx - Product views → Typed API client: requests data
src/frontend/src/api/client.ts - Product views → Shared filters: builds queries
src/frontend/src/lib/filters.ts - Ingest interface → Typed API client: posts logs
src/frontend/src/pages/IngestPage.tsx - File import → Typed API client: submits imports
src/frontend/src/components/ImportPanel.tsx - Ingest interface → File import: renders
src/frontend/src/components/ImportPanel.tsx - Ingest interface → Result display: shows outcomes
src/frontend/src/pages/IngestPage.tsx - Product views → Recent analyses: remembers analyses
src/frontend/src/pages/AnalysisPage.tsx - Typed API client → FastAPI application: calls HTTP API
src/frontend/src/api/client.ts - FastAPI application → Log endpoints: registers routes
- FastAPI application → Analysis endpoints: registers routes
- FastAPI application → Health endpoint: registers routes
- Log endpoints → Ingestion service: delegates ingest
src/api/routers/logs.py - Log endpoints → Raw log import: parses imports
src/api/routers/logs.py - Ingestion service → Log validation: validates records
src/api/services/ingestion.py - Ingestion service → Log repository: stores valid logs
src/api/services/ingestion.py - Raw log import → Ingestion service: supplies records
- Log repository → Log and analysis tables: queries and writes
src/api/repositories/logs.py - Log and analysis tables → PostgreSQL: persists records
src/api/database/tables.py - Log validation → ECS mapping: normalizes ECS
src/api/schemas/logs.py - Analysis endpoints → Analysis service: delegates analysis
- Analysis service → Pattern extraction: extracts patterns
- Analysis service → Typed LLM agent: requests analysis
- Typed LLM agent → LLM providers: uses configured model
- Analysis service → PostgreSQL: persists outcomes