mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-25 08:55:58 +03:00
[GH-ISSUE #215] Provide fastapi monitoring middleware #491
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#491
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AJaySi on GitHub (Aug 22, 2025).
Original GitHub issue: https://github.com/AJaySi/ALwrity/issues/215
Originally assigned to: @AJaySi on GitHub.
Presently, its already getting difficult to keep of api calls and the monitoring of APIs is needed for better debuggability.
API Monitoring System
A comprehensive, real-time monitoring system for the ALwrity backend API with beautiful charts, animations, and performance analytics.
🎯 Overview
The API Monitoring System provides real-time insights into API performance, error rates, cache efficiency, and system health through an intuitive dashboard with interactive charts and animations.
✨ Features
📊 Real-time Monitoring
🎨 Interactive Dashboard
🔧 Smart Monitoring
🚀 Quick Start
Backend Setup
Install Dependencies
Create Database Tables
Generate Test Data (Optional)
Start Backend
Frontend Setup
Install Dependencies
Start Development Server
📊 Dashboard Features
System Status Indicator
Monitoring Dashboard
📈 Chart Types
1. Request Trends (Line Chart)
2. Response Times (Area Chart)
3. Endpoint Performance (Bar Chart)
4. Cache Performance (Pie Chart)
5. System Health (Radar Chart)
🔧 Configuration
Excluded Endpoints
The following endpoints are excluded from monitoring to prevent self-monitoring loops:
Database Tables
api_requests- Individual API request logsapi_endpoint_stats- Aggregated endpoint statisticssystem_health- System health snapshotscache_performance- Cache performance metricscomprehensive_user_data_cache- User data caching📡 API Endpoints
Monitoring Endpoints
GET /api/content-planning/monitoring/lightweight-stats- Dashboard header statsGET /api/content-planning/monitoring/api-stats- Detailed API statisticsGET /api/content-planning/monitoring/cache-stats- Cache performance dataGET /api/content-planning/monitoring/health- Overall system healthResponse Format
🎨 UI Components
SystemStatusIndicator
frontend/src/components/ContentPlanningDashboard/components/SystemStatusIndicator.tsxMonitoringCharts
frontend/src/components/ContentPlanningDashboard/components/MonitoringCharts.tsx🔍 Troubleshooting
Dashboard Not Opening
No Monitoring Data
python scripts/generate_test_monitoring_data.pyHigh Log Volume
📊 Performance Benefits
Before Monitoring System
After Monitoring System
🛠️ Development
Adding New Metrics
backend/models/api_monitoring.pybackend/middleware/monitoring_middleware.pybackend/api/content_planning/api/routes/monitoring.pyfrontend/src/components/ContentPlanningDashboard/components/MonitoringCharts.tsxCustomizing Charts
COLORSarray in MonitoringCharts📝 Scripts
Database Management
🎯 Success Metrics
🔮 Future Enhancements
Built with: FastAPI, React, Material-UI, Recharts, Framer Motion, SQLAlchemy
Last Updated: August 2025
@AJaySi commented on GitHub (Aug 22, 2025):
@AJaySi commented on GitHub (Sep 1, 2025):
There are improvements for caching and AI API keys monitoring. We will take that up in a new issue/enhancement.