feat(monitoring): add retention policies for monitoring collections

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Martin Porwoll 2026-02-15 00:33:43 +00:00
parent 0ff8b5c9d8
commit d252ed321a

View file

@ -50,6 +50,31 @@ export const retentionPolicies: RetentionPolicy[] = [
batchSize: 50,
description: 'Consent-Logs nach Ablaufdatum löschen (DSGVO: 3 Jahre)',
},
// Monitoring Collections
{
name: 'monitoring-snapshots',
collection: 'monitoring-snapshots',
retentionDays: parseInt(process.env.RETENTION_MONITORING_SNAPSHOTS_DAYS || '7', 10),
dateField: 'createdAt',
batchSize: 500,
description: 'Monitoring-Snapshots älter als X Tage löschen',
},
{
name: 'monitoring-alert-history',
collection: 'monitoring-alert-history',
retentionDays: parseInt(process.env.RETENTION_MONITORING_ALERTS_DAYS || '90', 10),
dateField: 'createdAt',
batchSize: 100,
description: 'Alert-History älter als X Tage löschen',
},
{
name: 'monitoring-logs',
collection: 'monitoring-logs',
retentionDays: parseInt(process.env.RETENTION_MONITORING_LOGS_DAYS || '30', 10),
dateField: 'createdAt',
batchSize: 200,
description: 'Monitoring-Logs älter als X Tage löschen',
},
]
/**