Skip to content

Commit 388f08f

Browse files
authored
Merge pull request #17 from Finoptimize/dashboard
Adding a web dashboard
2 parents eece5b2 + 7fc3ef5 commit 388f08f

8 files changed

Lines changed: 1421 additions & 1 deletion

File tree

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,37 @@ The integration includes production-ready dashboards:
371371

372372
For complete setup guide and advanced configuration, see [examples/demo/PROMETHEUS_GRAFANA_DEMO.md](examples/demo/PROMETHEUS_GRAFANA_DEMO.md)
373373

374+
## 🌐 Interactive Web Dashboard
375+
376+
AgentaFlow now includes a **production-ready web dashboard** for real-time GPU monitoring and system analytics.
377+
378+
### 🚀 Quick Start Web Dashboard
379+
380+
```bash
381+
cd examples/demo/web-dashboard
382+
go run main.go
383+
```
384+
385+
**Access the dashboard**: http://localhost:8090
386+
387+
### ✨ Dashboard Features
388+
389+
- **📊 Real-time Monitoring**: Live GPU metrics with WebSocket updates
390+
- **📈 Interactive Charts**: GPU utilization, temperature, and cost analytics
391+
- **🎯 System Overview**: Total GPUs, efficiency scoring, and cost tracking
392+
- **🚨 Alert Management**: Real-time notifications and one-click resolution
393+
- **📱 Responsive Design**: Optimized for desktop, tablet, and mobile
394+
- **🔌 API Integration**: REST endpoints for custom integrations
395+
396+
### 🎯 Use Cases
397+
398+
- **Data Center Operations** - Real-time cluster monitoring
399+
- **Cost Management** - Live cost tracking and optimization
400+
- **Performance Analysis** - Identify bottlenecks and inefficiencies
401+
- **Alert Management** - Proactive issue detection and resolution
402+
403+
For detailed dashboard documentation, see [examples/demo/web-dashboard/README.md](examples/demo/web-dashboard/README.md)
404+
374405
## 📖 Documentation
375406

376407
For detailed documentation, see [DOCUMENTATION.md](DOCUMENTATION.md)
@@ -412,7 +443,7 @@ Contributions are welcome! This is a community edition focused on providing acce
412443
- ✅ Real-time GPU metrics collection
413444
-**Prometheus/Grafana integration** - Complete monitoring stack with dashboards
414445
-**Production-ready observability** - Enterprise-grade metrics export and visualization
415-
- 🔄 Web dashboard for monitoring
446+
- **Web dashboard for monitoring** - Interactive real-time web interface with charts and alerts
416447
- 🔄 OpenTelemetry support for tracing
417448

418449
## 🚀 Enterprise Edition (Coming Soon)
Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
# AgentaFlow Web Dashboard Demo
2+
3+
This demo showcases the comprehensive web-based monitoring dashboard for AgentaFlow SRO Community Edition, providing real-time GPU monitoring, cost tracking, and system analytics through a modern web interface.
4+
5+
## 🎯 Overview
6+
7+
The web dashboard provides:
8+
- **Real-time GPU monitoring** with live charts and metrics
9+
- **Interactive visualizations** using Chart.js
10+
- **WebSocket-based updates** for instant data refresh
11+
- **Cost analytics** with live tracking and forecasting
12+
- **Alert management** with real-time notifications
13+
- **System health monitoring** with efficiency scoring
14+
- **Responsive design** optimized for desktop and mobile
15+
16+
## 🚀 Quick Start
17+
18+
### Run the Demo
19+
20+
```bash
21+
# From the project root
22+
cd examples/demo/web-dashboard
23+
go run main.go
24+
```
25+
26+
### Access the Dashboard
27+
28+
Once started, the demo provides:
29+
30+
- **🌐 Web Dashboard**: http://localhost:8090
31+
- **📈 Prometheus Metrics**: http://localhost:8080/metrics
32+
33+
## 📊 Dashboard Features
34+
35+
### Real-time Monitoring
36+
- Live GPU utilization, temperature, and power consumption
37+
- Memory usage tracking across all GPUs
38+
- System-wide performance metrics
39+
- Automatic refresh every 3 seconds via WebSocket
40+
41+
### Interactive Charts
42+
- **GPU Performance Chart**: Real-time utilization and temperature trends
43+
- **Cost Analytics Chart**: Hourly cost tracking and forecasting
44+
- **Historical Data**: Last 20 data points with smooth animations
45+
46+
### System Overview Cards
47+
- Total and active GPU count
48+
- Average utilization across cluster
49+
- Total power consumption
50+
- Efficiency scoring (0-100%)
51+
- Daily cost tracking
52+
53+
### GPU Status Cards
54+
- Individual GPU monitoring
55+
- Real-time utilization bars
56+
- Temperature color coding
57+
- Memory usage indicators
58+
59+
### Alert Management
60+
- Real-time alert notifications
61+
- Temperature warnings (>75°C)
62+
- High utilization alerts (>95%)
63+
- Memory usage warnings (>90%)
64+
- One-click alert resolution
65+
66+
## 🎮 Demo Data
67+
68+
The demo generates realistic simulated data:
69+
70+
### GPU Metrics (every 5 seconds)
71+
- Simulated GPU utilization (0-100%)
72+
- Temperature readings (40-85°C)
73+
- Memory usage patterns
74+
- Power consumption data
75+
76+
### Cost Tracking (every 10 seconds)
77+
- Inference operation costs
78+
- GPU hour tracking
79+
- Token usage counting
80+
- Real-time cost accumulation
81+
82+
### Alerts
83+
- Automatic temperature alerts when >75°C
84+
- High utilization notifications
85+
- Memory usage warnings
86+
- WebSocket broadcast to all clients
87+
88+
## 🌐 API Endpoints
89+
90+
The dashboard exposes REST API endpoints:
91+
92+
### System Information
93+
- `GET /` - Main dashboard interface
94+
- `GET /health` - System health check
95+
- `GET /api/v1/metrics` - Complete metrics data
96+
- `GET /api/v1/system/stats` - System statistics
97+
98+
### GPU Specific
99+
- `GET /api/v1/gpu/{id}/metrics` - Individual GPU metrics
100+
- `GET /api/v1/costs` - Cost information
101+
- `GET /api/v1/performance` - Performance analytics
102+
103+
### Alert Management
104+
- `GET /api/v1/alerts` - Active alerts
105+
- `POST /api/v1/alerts/{id}/resolve` - Resolve alert
106+
107+
### Real-time Updates
108+
- `GET /ws` - WebSocket endpoint for live updates
109+
110+
## 🔧 Configuration
111+
112+
The dashboard can be configured via `WebDashboardConfig`:
113+
114+
```go
115+
dashboardConfig := observability.WebDashboardConfig{
116+
Port: 8090, // Web server port
117+
Title: "Custom Title", // Dashboard title
118+
RefreshInterval: 3000, // Update interval (ms)
119+
EnableRealTimeUpdates: true, // WebSocket updates
120+
Theme: "dark", // UI theme
121+
}
122+
```
123+
124+
## 📱 Responsive Design
125+
126+
The dashboard is fully responsive and works on:
127+
- **Desktop computers** (1920x1080 and higher)
128+
- **Tablets** (768px and up)
129+
- **Mobile devices** (576px and up)
130+
- **Large displays** (4K and ultra-wide monitors)
131+
132+
## 🎨 Themes
133+
134+
Currently supports:
135+
- **Dark Theme** (default) - Optimized for monitoring environments
136+
- Light theme support planned for future releases
137+
138+
## 🔌 Integration
139+
140+
### With Prometheus
141+
The dashboard integrates seamlessly with Prometheus:
142+
- Metrics automatically exported to `/metrics` endpoint
143+
- Compatible with existing Prometheus configurations
144+
- Works alongside Grafana for advanced analytics
145+
146+
### With GPU Metrics Collector
147+
- Real-time data from `gpu.MetricsCollector`
148+
- Automatic GPU discovery and monitoring
149+
- Health status tracking and alerting
150+
151+
### With Cost Tracking
152+
- Integration with `MonitoringService` cost tracking
153+
- Real-time cost calculations
154+
- Historical cost analysis and forecasting
155+
156+
## 🛠️ Development
157+
158+
### Adding Custom Metrics
159+
```go
160+
// Add custom metric to dashboard
161+
dashboard.BroadcastSystemUpdate(map[string]interface{}{
162+
"custom_metric": "value",
163+
"timestamp": time.Now(),
164+
})
165+
```
166+
167+
### Custom Alerts
168+
```go
169+
// Send custom alert
170+
alert := observability.Alert{
171+
ID: "custom-alert-123",
172+
Level: "warning",
173+
Message: "Custom alert message",
174+
Source: "system",
175+
Timestamp: time.Now(),
176+
}
177+
dashboard.BroadcastAlert(alert)
178+
```
179+
180+
### Notifications
181+
```go
182+
// Send notification to all connected clients
183+
dashboard.SendNotification("Title", "Message", "success")
184+
```
185+
186+
## 🚀 Production Deployment
187+
188+
For production use:
189+
190+
1. **Reverse Proxy**: Use nginx or similar for SSL termination
191+
2. **Authentication**: Add authentication middleware
192+
3. **Monitoring**: Monitor WebSocket connections and memory usage
193+
4. **Scaling**: Consider horizontal scaling for multiple dashboard instances
194+
195+
### Docker Deployment
196+
```dockerfile
197+
FROM golang:1.21-alpine AS builder
198+
WORKDIR /app
199+
COPY . .
200+
RUN go build -o dashboard examples/demo/web-dashboard/main.go
201+
202+
FROM alpine:latest
203+
RUN apk --no-cache add ca-certificates
204+
WORKDIR /root/
205+
COPY --from=builder /app/dashboard .
206+
EXPOSE 8090
207+
CMD ["./dashboard"]
208+
```
209+
210+
## 🔍 Troubleshooting
211+
212+
### WebSocket Connection Issues
213+
- Check firewall settings for port 8090
214+
- Ensure WebSocket support in proxy configuration
215+
- Verify browser WebSocket support
216+
217+
### Performance Issues
218+
- Monitor memory usage with multiple connections
219+
- Adjust refresh intervals for lower-powered systems
220+
- Consider connection limits for high-traffic scenarios
221+
222+
### Data Issues
223+
- Verify GPU metrics collector is running
224+
- Check Prometheus exporter configuration
225+
- Ensure monitoring service is recording data
226+
227+
## 📈 Metrics Available
228+
229+
### GPU Metrics
230+
- `utilization_gpu` - GPU utilization percentage
231+
- `utilization_memory` - Memory utilization percentage
232+
- `temperature` - GPU temperature in Celsius
233+
- `power_draw` - Current power consumption
234+
- `memory_used` - Used memory in MB
235+
- `memory_total` - Total memory in MB
236+
- `fan_speed` - Fan speed percentage
237+
238+
### System Metrics
239+
- `total_gpus` - Total number of GPUs
240+
- `active_gpus` - Number of active GPUs
241+
- `average_utilization` - Average GPU utilization
242+
- `efficiency_score` - System efficiency score (0-100)
243+
- `total_power_watts` - Total power consumption
244+
245+
### Cost Metrics
246+
- `total_cost` - Total accumulated cost
247+
- `hourly_cost` - Current hourly cost rate
248+
- `gpu_hours` - GPU hours consumed
249+
- `tokens_used` - Total tokens processed
250+
251+
## 🎯 Use Cases
252+
253+
1. **Data Center Monitoring** - Real-time GPU cluster oversight
254+
2. **Cost Optimization** - Track and optimize GPU spending
255+
3. **Performance Debugging** - Identify bottlenecks and inefficiencies
256+
4. **Capacity Planning** - Monitor utilization for scaling decisions
257+
5. **Alert Management** - Proactive issue detection and resolution
258+
6. **Resource Allocation** - Optimize workload distribution
259+
260+
## 🔮 Future Enhancements
261+
262+
Planned features for upcoming releases:
263+
- **Multi-cluster support** - Monitor multiple GPU clusters
264+
- **Historical analytics** - Long-term trend analysis
265+
- **Custom dashboards** - User-configurable layouts
266+
- **Advanced alerting** - Configurable alert rules
267+
- **Export capabilities** - PDF and CSV export options
268+
- **Mobile app** - Native mobile application

0 commit comments

Comments
 (0)