Session history
Review past MQTT connections and analyze connection patterns.
Session history shows past connections to your MQTT broker. Use it to analyze patterns, debug intermittent disconnects, and audit connection activity.
Accessing session history
- Log into the CloudSignal dashboard
- Click Sessions in the sidebar
- Select History tab
Understanding history records
Each history entry shows:
| Field | Description |
|---|---|
| Client ID | The MQTT client identifier |
| Username | The authenticated user |
| Connected At | When the connection was established |
| Disconnected At | When the connection ended |
| Duration | How long the session lasted |
| Disconnect reason | Why the connection ended |
Disconnect reasons
| Reason | Description |
|---|---|
| Normal | Client disconnected gracefully |
| Keep-alive timeout | Client stopped responding to pings |
| Client disconnect | Client sent DISCONNECT packet |
| Server disconnect | Broker closed the connection |
| Takeover | New connection with same client ID |
| Auth failure | Authentication rejected |
| Protocol error | Invalid MQTT packets |
Filtering history
By time range
Select a time period:
- Last hour
- Last 24 hours
- Last 7 days
- Custom range
By client
Search for specific clients:
Search: agent-001
-> Shows all historical sessions for agent-001By disconnect reason
Filter to see only certain types of disconnections:
- All disconnects
- Normal only
- Errors only
- Timeouts only
Analyzing patterns
Connection frequency
Review how often clients connect and disconnect:
agent-001 history (last 24h):
Connected: 08:00 -> Disconnected: 20:00 (12h)
Connected: 08:00 -> Disconnected: 20:00 (12h)
Pattern: client connects during working hours onlyShort-lived connections
Identify unstable connections:
mobile-app history (last hour):
Connected: 10:00:00 -> 10:00:05 (5s)
Connected: 10:00:10 -> 10:00:15 (5s)
Connected: 10:00:20 -> 10:00:25 (5s)
Problem: client is in a reconnection loopKeep-alive timeouts
Clients that stop responding:
gateway-001 history:
Disconnect reason: Keep-alive timeout
Duration: 45 minutes
Possible causes:
- Network dropped without clean disconnect
- Client process crashed
- Firewall closed connectionCommon investigations
"Why did my client disconnect?"
- Find the session in history
- Check the Disconnect reason
- Review the Duration (was it expected?)
- Look for patterns (same time each day?)
"Is my client reliably connected?"
- Filter history for the specific client
- Count disconnections in a time period
- Check if disconnects are normal or errors
Last 7 days for agent-001:
Total sessions: 7
Normal disconnects: 7
Error disconnects: 0
Average duration: 24h
Status: Healthy - one clean reconnect per day"What happened at 3am?"
- Set time filter to the period in question
- Review all disconnections
- Look for mass disconnects (server issue) vs individual (client issue)
2024-01-15 03:00-03:05:
50 clients disconnected
Reason: Server restart (planned maintenance)Session timeline view
Click on a client to see a visual timeline (rendered in the dashboard, not as text). The dashboard shows per-day connection bars across the selected time range so you can spot gaps and short reconnects at a glance.
Exporting history
Export session history for external analysis:
- Set your filters
- Click Export
- Choose format (CSV, JSON)
- Download
| Use case | Why export helps |
|---|---|
| Compliance audits | Record connection activity for review |
| Capacity planning | Long-range trends beyond dashboard view |
| Custom analytics | Combine with your own data sources |
Retention period
Session history is retained based on your plan:
- Free: 7 days
- Pro: 30 days
- Enterprise: Custom retention
Best practices
Regular review
Weekly checks:
- Look for unexpected disconnect patterns
- Identify clients with frequent reconnections
- Review any error disconnects
Alerting
Set up alerts for:
- Disconnect rate exceeding threshold
- Specific clients disconnecting unexpectedly
- Mass disconnection events
Correlation
Compare session history with:
- Your deployment schedules
- Network maintenance windows
- Application log timestamps
Next steps
- Active sessions - Current connections
- Troubleshooting - Debug issues
- MQTT fundamentals - Understanding keep-alive