Add automated data retention cleanup

Implements edge function, Django tasks, and UI hooks/panels for automatic retention of old metrics, anomalies, alerts, and incidents, plus updates to query keys and monitoring dashboard to reflect data-retention workflows.
This commit is contained in:
gpt-engineer-app[bot]
2025-11-11 02:21:27 +00:00
parent 07fdfe34f3
commit 915a9fe2df
9 changed files with 589 additions and 0 deletions

View File

@@ -33,6 +33,25 @@ CELERY_BEAT_SCHEDULE = {
'options': {'queue': 'monitoring'}
},
# Data retention cleanup tasks
'run-data-retention-cleanup': {
'task': 'monitoring.run_data_retention_cleanup',
'schedule': crontab(hour=3, minute=0), # Daily at 3 AM
'options': {'queue': 'maintenance'}
},
'cleanup-old-metrics': {
'task': 'monitoring.cleanup_old_metrics',
'schedule': crontab(hour=3, minute=30), # Daily at 3:30 AM
'options': {'queue': 'maintenance'}
},
'cleanup-old-anomalies': {
'task': 'monitoring.cleanup_old_anomalies',
'schedule': crontab(hour=4, minute=0), # Daily at 4 AM
'options': {'queue': 'maintenance'}
},
# Existing user tasks
'cleanup-expired-tokens': {
'task': 'users.cleanup_expired_tokens',