mirror of
https://github.com/sstent/consul-monitor.git
synced 2025-12-06 08:01:58 +00:00
2.5 KiB
2.5 KiB
Phase 3 Implementation Plan - Service Grouping and Scalability
Overview
Implemented service grouping with composite health reporting and UI scalability enhancements to support up to 30 services.
Key Features
- Service Grouping: Services are grouped by name into single rows
- Composite Health: Overall service health based on all instances
- Scalability: UI optimizations to support 30+ services
Implementation Details
Backend Modifications
-
Service Grouping Logic (database.py)
- Added
get_all_services_grouped()function - Implemented composite health calculation per service
- Returns aggregated service data with instance lists
- Added
-
Database Queries
- Created optimized query to group services by name
- Added composite status calculation in SQL
- Maintained instance details within service groups
-
API Endpoint Updates (app.py)
- Modified
/api/servicesto return service groups - Added service-based instance grouping in responses
- Modified
Frontend Changes
-
Table Redesign (index.html)
- Converted to service-based table structure
- Added expandable rows for instance details
- Implemented service health indicators
-
Health Reporting UI
- Added composite status indicators per service
- Maintained instance-level health details
- Preserved history chart functionality
-
Scalability Features
- Added expand/collapse functionality
- Optimized UI for 30+ services
- Efficient data loading with grouping
Health Calculation
- Status Algorithm
- Critical if any instance critical
- Warning if any instance warning (no criticals)
- Passing if all instances passing
Implementation Sequence
- Updated database.py for service grouping
- Modified app.py endpoints to use service groups
- Redesigned frontend to display service groups
- Added expand/collapse functionality for instances
- Maintained URL generation for instances
- Added error handling for new data model
Testing Considerations
- Verify service grouping by name
- Test composite health calculation logic
- Validate expand/collapse functionality
- Test with 30+ services to ensure scalability
- Verify history charts still function properly
- Test error handling for Consul unavailability
Estimated Implementation Time
Total: 4-5 hours
Next Steps
- Implement pagination for large service sets
- Add search/filter functionality
- Optimize database queries for large datasets
- Implement service-level history charts