How To: Monitor Your Bot ๐ก BETA
Tutorial 12 of the Analytics & Monitoring Series
Watch conversations and system health in real-time
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ โ
โ โ ๐ MONITOR YOUR BOT โ โ
โ โ โ โ
โ โ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โ โ
โ โ โ Step โโโโโถโ Step โโโโโถโ Step โโโโโถโ Step โ โ โ
โ โ โ 1 โ โ 2 โ โ 3 โ โ 4 โ โ โ
โ โ โ Access โ โ View โ โ Check โ โ Set โ โ โ
โ โ โDashboardโ โSessions โ โ Health โ โ Alerts โ โ โ
โ โ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โ โ
โ โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Objective
By the end of this tutorial, you will have:
- Accessed the monitoring dashboard
- Viewed active sessions and conversations
- Checked system health and resources
- Understood the live system architecture
- Configured alerts for important events
Time Required
โฑ๏ธ 10 minutes
Prerequisites
Before you begin, make sure you have:
- A running bot with some activity
- Administrator or Monitor role permissions
- Access to the General Bots Suite
Understanding the System Architecture
Your General Bots deployment is a living system of interconnected components. Understanding how they work together helps you monitor effectively.
Component Overview
| Component | Purpose | Status Indicators |
|---|---|---|
| botserver | Core application, handles all requests | Response time, active sessions |
| PostgreSQL | Primary database, stores users & config | Connections, query rate |
| Qdrant | Vector database, powers semantic search | Vector count, search latency |
| MinIO | File storage, manages documents | Storage used, object count |
| BotModels | LLM server, generates AI responses | Tokens/hour, model latency |
| Vault | Secrets manager, stores API keys | Sealed status, policy count |
| Cache | Cache layer, speeds up responses | Hit rate, memory usage |
| InfluxDB | Metrics database, stores analytics | Points/sec, retention |
Step 1: Access the Monitoring Dashboard
1.1 Open the Apps Menu
Click the nine-dot grid (โฎโฎโฎ) in the top-right corner.
1.2 Select Monitoring
Click Analytics or Monitoring (depending on your configuration).
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโ โ
โ โ ๐ฌ Chat โ โ
โ โ ๐ Drive โ โ
โ โ ๐ Analytics โ โโโ May be here โ
โ โ ๐ Monitoring โ โโโ Or here โ
โ โ โ๏ธ Settings โ โ
โ โโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1.3 View the Dashboard
The monitoring dashboard displays real-time metrics:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ Monitoring Dashboard ๐ด LIVE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ SESSIONS โ โ MESSAGES โ โ RESPONSE โ โ
โ โ โ โ โ โ โ โ
โ โ 247 โ โ 12.4K โ โ 1.2s โ โ
โ โ โ Active โ โ Today โ โ Average โ โ
โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ SYSTEM RESOURCES โ
โ โโโโโโโโโโโโโโโโโ โ
โ CPU [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 70% โ
โ MEM [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 60% โ
โ GPU [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 40% โ
โ DISK [โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ] 28% โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Checkpoint: You can see the monitoring dashboard with live metrics.
Step 2: View Active Sessions
2.1 Navigate to Sessions Panel
Look for the Sessions or Conversations section:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Active Sessions (247) [Refresh ๐] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ ID โ User โ Channel โ Started โ Messages โ
โ โโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโ โ
โ a1b2c3d4 โ +5511999... โ WhatsApp โ 2 min ago โ 12 โ
โ e5f6g7h8 โ john@acme... โ Web โ 5 min ago โ 8 โ
โ i9j0k1l2 โ +5521888... โ WhatsApp โ 8 min ago โ 23 โ
โ m3n4o5p6 โ support@... โ Email โ 15 min ago โ 4 โ
โ q7r8s9t0 โ jane@... โ Web โ 18 min ago โ 15 โ
โ โ
โ โ 1 2 3 4 5 ... 25 โถ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
2.2 View Session Details
Click on a session to see the full conversation:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Session: a1b2c3d4 [ร] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ User: +5511999888777 โ
โ Channel: WhatsApp โ
โ Started: 2024-01-15 14:32:00 โ
โ Duration: 2 min 34 sec โ
โ Bot: mycompany โ
โ โ
โ โโ Conversation โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ [14:32:00] ๐ค User: Hello โ
โ [14:32:01] ๐ค Bot: Hello! How can I help you today? โ
โ [14:32:15] ๐ค User: I want to check my order status โ
โ [14:32:17] ๐ค Bot: I can help with that! What's your order number? โ
โ [14:32:45] ๐ค User: ORD-12345 โ
โ [14:32:48] ๐ค Bot: Order ORD-12345 is being prepared for shipping... โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
2.3 Session Metrics
Understand key session metrics:
| Metric | Description | Good Value |
|---|---|---|
| Active Sessions | Currently open conversations | Depends on load |
| Peak Today | Maximum concurrent sessions | Track trends |
| Avg Duration | Average conversation length | 3-5 minutes typical |
| Messages/Session | Average messages per conversation | 5-10 typical |
โ Checkpoint: You can view active sessions and their conversations.
Step 3: Check System Health
3.1 View Service Status
The dashboard shows the health of all components:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Service Health โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โ PostgreSQL Running v16.2 24/100 connections โ
โ โ Qdrant Running v1.9.2 1.2M vectors โ
โ โ MinIO Running v2024.01 45.2 GB stored โ
โ โ BotModels Running v2.1.0 LLM active โ
โ โ Vault Sealed v1.15.0 156 secrets โ
โ โ Cache Running v7.2.4 94.2% hit rate โ
โ โ InfluxDB Running v2.7.3 2,450 pts/sec โ
โ โ
โ Legend: โ Running โ Warning โ Stopped โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
3.2 Understanding Status Colors
| Color | Status | Action Needed |
|---|---|---|
| ๐ข Green | Healthy/Running | None |
| ๐ก Yellow | Warning/Degraded | Investigate soon |
| ๐ด Red | Error/Stopped | Immediate action |
3.3 Check Resource Usage
Monitor resource utilization to prevent issues:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Resource Usage Last 24 Hours โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ CPU Usage โ
โ 100%โ โญโโโฎ โ
โ 75%โ โญโโโฎ โญโโโฎ โ โ โญโโโฎ โ
โ 50%โโญโโโฎโ โโญโโฏ โฐโโฎโญโโโฏ โฐโโโฏ โฐโโโฎ โ
โ 25%โ โฐโโโฏ โฐโฏ โฐโโโโโโโโโโ โ
โ 0%โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ 00:00 04:00 08:00 12:00 16:00 20:00 Now โ
โ โ
โ Memory Usage โ
โ 100%โ โ
โ 75%โ โ
โ 50%โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ 25%โ โ
โ 0%โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ 00:00 04:00 08:00 12:00 16:00 20:00 Now โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
3.4 Resource Thresholds
Take action when resources approach these limits:
| Resource | Warning | Critical | Action |
|---|---|---|---|
| CPU | > 80% | > 95% | Scale up or optimize |
| Memory | > 85% | > 95% | Add RAM or reduce cache |
| Disk | > 80% | > 90% | Clean up or add storage |
| GPU | > 90% | > 98% | Queue requests or scale |
โ Checkpoint: You can view system health and resource usage.
Step 4: Set Up Alerts
4.1 Access Alert Settings
Navigate to Settings > Alerts or Monitoring > Configure Alerts.
4.2 Configure Alert Rules
Set up alerts for important events:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Alert Configuration โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โ CPU Usage โ
โ Threshold: [80] % For: [5] minutes โ
โ Notify: โ Email โ Slack โ SMS โ
โ โ
โ โ Memory Usage โ
โ Threshold: [85] % For: [5] minutes โ
โ Notify: โ Email โ Slack โ SMS โ
โ โ
โ โ Response Time โ
โ Threshold: [5000] ms For: [3] minutes โ
โ Notify: โ Email โ Slack โ SMS โ
โ โ
โ โ Service Down โ
โ Services: โ PostgreSQL โ Qdrant โ BotModels โ
โ Notify: โ Email โ Slack โ SMS โ
โ โ
โ โโโโโโโโโโโโโโโโโโโ โ
โ โ ๐พ Save โ โ
โ โโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
4.3 Configure via config.csv
You can also set alerts in your botโs configuration file:
key,value
alert-cpu-threshold,80
alert-memory-threshold,85
alert-disk-threshold,90
alert-response-time-ms,5000
alert-email,admin@company.com
alert-slack-webhook,https://hooks.slack.com/...
4.4 Test Alerts
Verify your alerts are working:
- Set a low threshold temporarily (e.g., CPU > 1%)
- Wait for the alert to trigger
- Check your email/Slack for the notification
- Reset the threshold to normal
โ Checkpoint: Alerts are configured and tested.
๐ Congratulations!
You can now monitor your bot effectively! Hereโs what you learned:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ โ Accessed the monitoring dashboard โ
โ โ Viewed active sessions and conversations โ
โ โ Checked system health and services โ
โ โ Understood resource usage metrics โ
โ โ Configured alerts for important events โ
โ โ
โ You're now equipped to keep your bot healthy! โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Troubleshooting
Problem: Dashboard shows no data
Cause: Monitoring services may not be collecting data.
Solution:
- Check that InfluxDB is running
- Verify the monitoring agent is enabled
- Wait a few minutes for data collection
Problem: Sessions show as โUnknown Userโ
Cause: User identification not configured.
Solution:
- Enable user tracking in bot settings
- Request user info at conversation start
- Check privacy settings
Problem: Alerts not being sent
Cause: Notification channels not configured correctly.
Solution:
- Verify email/Slack settings
- Check spam folders
- Test webhook URLs manually
Problem: High CPU but few sessions
Cause: Possible memory leak or inefficient code.
Solution:
- Check for infinite loops in dialogs
- Review LLM call frequency
- Restart the bot service
Monitoring API
Access monitoring data programmatically:
Get System Status
GET /api/monitoring/status
Response:
{
"sessions": {
"active": 247,
"peak_today": 312,
"avg_duration_seconds": 245
},
"messages": {
"today": 12400,
"this_hour": 890,
"avg_response_ms": 1200
},
"resources": {
"cpu_percent": 70,
"memory_percent": 60,
"gpu_percent": 40,
"disk_percent": 28
},
"services": {
"postgresql": "running",
"qdrant": "running",
"minio": "running",
"botmodels": "running",
"vault": "sealed",
"redis": "running",
"influxdb": "running"
}
}
Get Historical Metrics
GET /api/monitoring/history?period=24h
Get Session Details
GET /api/monitoring/sessions/{session_id}
Quick Reference
Dashboard Keyboard Shortcuts
| Shortcut | Action |
|---|---|
R | Refresh data |
F | Toggle fullscreen |
S | Show/hide sidebar |
1-7 | Switch dashboard tabs |
Important Metrics to Watch
| Metric | Normal | Warning | Critical |
|---|---|---|---|
| Response Time | < 2s | 2-5s | > 5s |
| Error Rate | < 1% | 1-5% | > 5% |
| CPU Usage | < 70% | 70-85% | > 85% |
| Memory Usage | < 75% | 75-85% | > 85% |
| Queue Depth | < 100 | 100-500 | > 500 |
Console Monitoring
For server-side monitoring:
# Start with monitoring output
./botserver --console --monitor
# Output:
# [MONITOR] 2024-01-15 14:32:00
# Sessions: 247 active (peak: 312)
# Messages: 12,400 today (890/hour)
# CPU: 70% | MEM: 60% | GPU: 40%
# Services: 7/7 running
Next Steps
| Next Tutorial | What Youโll Learn |
|---|---|
| Create Custom Reports | Build dashboards for insights |
| Export Analytics Data | Download metrics for analysis |
| Performance Optimization | Make your bot faster |
Tutorial 12 of 30 โข Back to How-To Index โข Next: Create Custom Reports โ