-
Notifications
You must be signed in to change notification settings - Fork 0
Web Dashboard
Real-time monitoring dashboard for the Windows Event Automation Engine.
The web dashboard provides live visualization of engine activity through a web interface. It connects via WebSocket to receive real-time updates as events are processed.
Main dashboard showing live metrics and event stream
Once the engine is running, open your browser:
http://127.0.0.1:9090
Security Note: The dashboard is only accessible from localhost (127.0.0.1) for security. It cannot be accessed from other machines on the network.
Live event feed showing processed events
The center panel displays events as they occur:
- Event Type: FileCreated, ProcessStarted, etc.
- Source: Which plugin generated the event
- Timestamp: When the event occurred
- Details: Event-specific metadata (path, process name, etc.)
Filter Events: Use the buttons at the top to filter:
- All: Show all events
- Events: File system, window, process events
- Rules: Rule evaluations and matches
- Actions: Action executions
Real-time charts showing system activity
Four key metrics are displayed:
- Shows the rate of events being processed
- 60-second rolling history
- Helps identify spikes in activity
- Shows how many rules are matching per second
- Indicates how busy your automation is
- Bar chart showing successful vs failed actions
- Green = Success, Red = Error
- Uptime: How long the engine has been running
- Active Plugins: Number of running event sources
- Active Rules: Number of enabled rules
WebSocket connection indicator
Top-right corner shows connection state:
- 🟢 Green: Connected and receiving updates
- 🔴 Red: Disconnected (will auto-reconnect)
The dashboard establishes a WebSocket connection to the engine:
Browser ←→ WebSocket (ws://127.0.0.1:9090/ws) ←→ Engine
Connection Features:
- ✅ Auto-reconnect if connection drops
- ✅ Exponential backoff for reconnection attempts
- ✅ Sends full metrics snapshot every 5 seconds
- ✅ Pushes events immediately as they happen
- Event occurs (file created, process started, etc.)
- Engine processes the event through rules
- Metrics updated and broadcast via WebSocket
- Dashboard receives update and refreshes display
Latency: Typically <100ms from event to dashboard display.
Watch files being processed in real-time:
[Event] FileCreated: C:/Data/input.csv
[Rule] Data processing rule matched
[Action] Execute: python process.py
[Event] FileCreated: C:/Data/output.json
See which rules are matching and why:
[Rule] backup_important_files evaluated
[Rule] backup_important_files MATCHED
[Action] Script: backup.lua executed successfully
Identify bottlenecks:
- High events/sec but low rule matches? → Rules may be too restrictive
- High action failures? → Check action configurations
- Low events/sec? → Verify sources are configured correctly
At a glance:
- Is the engine running? ✅ Uptime counter
- Are plugins active? ✅ Active plugins count
- Are rules working? ✅ Rule match rate
The dashboard server also provides these endpoints:
GET http://127.0.0.1:9090/metrics
Returns metrics in Prometheus format for integration with monitoring systems.
GET http://127.0.0.1:9090/api/snapshot
Returns current metrics as JSON:
{
"timestamp": "2024-01-15T10:30:00Z",
"counters": {
"events_total": 150,
"rules_matched_total": 45
},
"gauges": {
"engine_uptime_seconds": 3600
}
}GET http://127.0.0.1:9090/health
Returns health status:
{
"status": "healthy",
"timestamp": "2024-01-15T10:30:00Z"
}Problem: Browser shows "This site can't be reached"
Solutions:
- Verify engine is running: Check console output
- Check port availability:
netstat -an | findstr 9090 - Try refreshing the page
- Check firewall isn't blocking localhost
Problem: Dashboard loads but event stream is empty
Solutions:
- Verify event sources are configured and enabled
- Check that rules match your test events
- Look at engine logs for errors
- Try triggering a test event manually
Problem: Red dot keeps appearing
Solutions:
- Check for high CPU/memory usage
- Verify network stability (though it's localhost)
- Check engine logs for errors
- May need to restart the engine
Problem: Metrics stuck at 0
Solutions:
- Check if events are being processed (check event stream)
- Verify WebSocket connection (green dot)
- Refresh the page
- Check browser console for JavaScript errors
Edit the engine configuration or modify the source to use a different port:
// In main.rs
let metrics_server = MetricsServer::new(metrics, 9090); // Change 9090The dashboard is a single HTML file. You can customize it by editing:
metrics/src/server.rs (DASHBOARD_HTML constant)
The dashboard uses embedded CSS. Modify the <style> section in server.rs to change:
- Colors
- Layout
- Font sizes
- Chart appearance
- CPU: Minimal (<1% on modern hardware)
- Memory: ~10-20MB for dashboard server
- Network: Localhost only, minimal bandwidth
- Browser: Works on any modern browser
The dashboard handles:
- ✅ 1000+ events per second
- ✅ Multiple browser tabs
- ✅ Automatic cleanup of old events (keeps last 100)
The server binds exclusively to 127.0.0.1:
let addr = SocketAddr::from(([127, 0, 0, 1], 9090));This means:
- ✅ Cannot be accessed from other machines
- ✅ Cannot be accessed via external IP
- ✅ Safe to run on public-facing servers
Currently no authentication is required because it's localhost-only. If you need to expose the dashboard:
- Use a reverse proxy (nginx, Apache)
- Add authentication at the proxy level
- Consider using HTTPS
- Configuration Reference - Configuring metrics endpoint
- Architecture - How the dashboard fits into the system
- Troubleshooting - General troubleshooting guide