Debug files retention policy
Environment
self-hosted (https://develop.sentry.dev/self-hosted/)
What are you trying to accomplish?
want to change the debug files retention policy.
How are you getting stuck?
according the doc, debug files will auto delete if has not been used to process incoming events for at least 90 days.
I want to change to 60 days. It's possible?
Where in the product are you?
Help
Link
No response
DSN
No response
Version
No response
Assigning to @getsentry/support for routing ⏲️
I wonder if the docs here are specifically for SaaS, will transfer over to sentry-native to see if they have a better idea about this.
@Swatinem is probably the right person to answer this.
If you use self-hosted, this can be changes easily, I’m just not entirely sure how. For SaaS, the retention window is configured where the period cleanup task is defined, will need to check to find out where that is defined in self-hosted.
Also note that due to debouncing, the actual time is 90-120 days.
@Swatinem I'm assuming that the SENTRY_EVENT_RETENTION_DAYS would be what this user would be looking for then. This can be changed to 60 days.
This can be found here: https://github.com/getsentry/self-hosted/blob/master/.env#L2
No, this is rather controlled by an invocation of the sentry cleanup script.
In production, we run it like so (private repo): https://github.com/getsentry/ops/blob/a7936fc37649893e8a28c4f524d1a5e4cd404c67/k8s/clusters/us/default.yaml#L575-L589
@hubertdeng123 I’m not too familiar how those scheduled jobs work for self-hosted.
Also note that bumping the access time of debug files is heavily debounced (once every 30 days), so if you would have to target 90 days for deletions to account for that. In that case, debug files aged 60-90 days will be cleaned up.
The SENTRY_EVENT_RETENTION_DAYS is used in the sentry cleanup script for self-hosted.
https://github.com/getsentry/self-hosted/blob/master/docker-compose.yml#L401C74-L401C74
Thanks for the context @Swatinem. I'm guessing if this user would specifically want to specifically set up a cleanup job just for debug files, they would need to set the option for model. So, that would look something like
0 0 * * * gosu sentry sentry cleanup --days 120 --model ProjectDebugFile
Yes, that looks about right to me.