This guide helps you monitor your translation workflows in real-time using WebSocket-based monitoring.
- Translation Progress: See real-time progress updates as your documents are translated
- SSH Workers: Monitor remote translation workers and their performance
- Error Tracking: Get immediate alerts when errors occur
- Session History: View past translation sessions and their results
- Performance Metrics: Track translation speed and worker efficiency
- Open your terminal
- Navigate to your project directory:
cd /Users/milosvasic/Projects/Translate - Start the monitoring server:
go run ./cmd/monitor-server
- You should see output like:
🚀 Starting Translation Monitoring Server 📡 WebSocket server listening on ws://localhost:8090/ws 🌐 Web dashboard available at http://localhost:8090/monitor
Keep this terminal open - the monitoring server needs to keep running.
- Open your web browser
- Go to:
http://localhost:8090/monitor - You should see a monitoring dashboard with:
- Active sessions counter
- Connection status indicator
- Event log area
- Progress tracking section
For advanced features, you can also open: file:///Users/milosvasic/Projects/Translate/enhanced-monitor.html
Choose one of the following options:
- Open a new terminal window
- Run the basic demo:
cd /Users/milosvasic/Projects/Translate go run demo-translation-with-monitoring-fixed.go - Watch the dashboard update in real-time!
- Optional: Set up your OpenAI API key:
export OPENAI_API_KEY=your_api_key_here - Run the real LLM demo:
go run demo-real-llm-with-monitoring.go
- Optional: Configure SSH worker (if you have remote workers):
export SSH_WORKER_HOST=localhost export SSH_WORKER_USER=milosvasic
- Run the SSH worker demo:
go run demo-ssh-worker-with-monitoring.go
As your translation runs, you'll see in the dashboard:
- Progress Bar: Shows overall completion percentage
- Current Step: What's happening right now (reading, translating, etc.)
- Event Log: Detailed log of all activities
- Session ID: Unique identifier for your translation session
- 0-10%: Reading and parsing input files
- 10-25%: Content preparation and conversion
- 25-85%: Actual translation work
- 85-100%: Generating output files
- 🟡 Yellow: Starting up or in progress
- 🟢 Green: Successfully completed
- 🔴 Red: Error occurred
- ⚪ Gray: Pending or idle
You'll see:
- ✅ Green "Completed" status
- 100% progress bar
- Output file location
- Total time taken
- Any worker information (for SSH translations)
You'll see:
- 🔴 Red error status
- Detailed error message
- Step where error occurred
- Troubleshooting suggestions
- Run multiple translations in parallel:
# Terminal 1 go run demo-translation-with-monitoring-fixed.go # Terminal 2 (simultaneously) go run demo-translation-with-monitoring-fixed.go # Terminal 3 (simultaneously) go run demo-translation-with-monitoring-fixed.go
- The dashboard will show all active sessions
If you have remote SSH workers configured:
- You'll see worker host and connection info
- Worker model and capacity details
- Real-time worker performance
- Connection status for each worker
- In the dashboard, enter a specific session ID
- Click "Monitor Session" to focus on one translation
- View detailed progress and events for that session
Solution: Make sure the monitoring server is running:
# Check if server is running
lsof -i :8090
# If not running, start it:
go run ./cmd/monitor-serverSolutions:
- Check that a translation is actually running
- Verify the translation process includes monitoring code
- Check browser console for JavaScript errors
Solutions:
- Verify SSH credentials are correct
- Test SSH connection manually:
ssh milosvasic@localhost 'echo "SSH works"' - Check worker configuration in config files
Solutions:
- Verify your API key is set:
echo $OPENAI_API_KEY
- Set the API key:
export OPENAI_API_KEY=your_actual_api_key
Solution: Kill the process using port 8090:
# Find the process
lsof -i :8090
# Kill it (replace PID with actual process ID)
kill -9 <PID>
# Restart server
go run ./cmd/monitor-server- Use a modern web browser (Chrome, Firefox, Safari)
- Keep the monitoring server on a stable network
- Don't run too many translations simultaneously on a slow computer
- Use the enhanced dashboard for better multi-worker support
- Consider increasing WebSocket timeout for slow connections
- Monitor worker capacity to avoid overloading
- Progress updates may be less frequent for large files
- Monitor memory usage on the translation machine
- Consider breaking very large files into smaller chunks
Q: Do I need to keep the monitoring server running? A: Yes, the monitoring server must stay running to track translations and serve the dashboard.
Q: Can I monitor translations running on different machines? A: Yes! Configure the translation clients to connect to your monitoring server's IP address instead of localhost.
Q: How long does the monitoring history last? A: Session history is stored in memory and lasts until you restart the monitoring server.
Q: Is my data secure? A: For development, data is sent over plain WebSocket. In production, consider using WSS (WebSocket Secure) and authentication.
Q: Can I export the monitoring data? A: Currently, data is displayed in the dashboard only. Export functionality is planned for future versions.
If you encounter issues:
- Check the logs in your terminal windows
- Look at browser console (F12 → Console tab)
- Try the basic demo first to ensure the system works
- Review the technical documentation in
docs/WebSocket_Monitoring_Guide.md - Check configuration files for any incorrect settings
- Ctrl+R: Refresh dashboard
- Ctrl+L: Clear event log
- F5: Full page refresh
| Command | Purpose |
|---|---|
go run ./cmd/monitor-server |
Start monitoring server |
go run demo-translation-with-monitoring-fixed.go |
Run basic demo |
go run demo-real-llm-with-monitoring.go |
Run real LLM demo |
go run demo-ssh-worker-with-monitoring.go |
Run SSH worker demo |
http://localhost:8090/monitor |
Basic dashboard |
enhanced-monitor.html |
Advanced dashboard |
Before you start monitoring real translations:
- Monitoring server running without errors
- Dashboard accessible in browser
- At least one demo runs successfully
- Real-time updates appear in dashboard
- No connection errors in browser console
- Translation output files are created
When all items are checked, you're ready to monitor your actual translation workflows!
Happy Monitoring! 🚀