Data Retention
LabTether stores several classes of operational data, each with configurable retention periods. Manage these at Settings -> Retention in the web console.
Data classes
| Data Class | What it includes | Default Retention | Storage Impact |
|---|---|---|---|
| Logs | Agent logs, system logs, structured log events | 14 days | High (scales with node count and log verbosity) |
| Metrics | CPU, memory, disk, network, container, and platform telemetry | 30 days | Medium-high (scales with node count and collection interval) |
| Audit events | Operator actions, login events, API key usage, setting changes | 90 days | Low (event-driven, not continuous) |
| Desktop recordings | Session recording files (WebM or backend format) | 30 days | Very high (video files, largest per-item data class) |
Tuning retention
Start with the defaults. The out-of-the-box retention periods work well for a typical homelab with 5-50 nodes. Only adjust once you understand your storage growth rate.
Shorten high-volume sources first. Logs and metrics are the biggest consumers. Cutting log retention from 30 days to 14 days on a 30-node fleet can save significant disk space. Metrics at a 10-second collection interval grow faster than metrics at 30 seconds.
Keep audit events longer than logs. Audit events are small and infrequent, but their value increases over time -- they are your operational paper trail for troubleshooting "who changed what" questions and compliance reviews.
Match recording retention to your storage budget. Desktop recordings are the largest single data class per item. A 30-minute 1080p recording can be hundreds of megabytes. If storage is tight, consider shorter retention or disabling recording for routine sessions and reserving it for specific troubleshooting or audit needs.
Storage monitoring
Keep an eye on database and volume size as your fleet grows:
# Check Postgres database size
docker exec labtether-postgres psql -U labtether -c "SELECT pg_size_pretty(pg_database_size('labtether'));"
# Check Docker volume disk usage
docker system df -v | grep labtether
If storage grows faster than expected, check:
- Log verbosity -- are any agents or connectors producing excessive log volume? Noisy sources can be tuned per-node.
- Collection interval -- shorter intervals mean more metric data points. The default is balanced, but if you tightened it, storage grows proportionally.
- Recording frequency -- if every desktop session is recorded, recordings will dominate storage.
Retention cleanup
LabTether runs periodic cleanup jobs to remove data older than the configured retention window. Cleanup is automatic -- you do not need to run it manually. Data is removed in batches to avoid locking the database during cleanup.
If you change retention settings, the new window applies on the next cleanup cycle. Existing data older than the new window will be removed at that time.
Tip: Review retention settings monthly for the first few months after setup. Once you know your storage growth rate, quarterly reviews are enough. Use
make db-backupbefore making significant retention changes -- you cannot recover data after it has been cleaned up.
See Settings for the full settings reference including retention-related runtime settings.