self-hosted icon indicating copy to clipboard operation
self-hosted copied to clipboard

Debug files retention policy

Open NikoLXQ opened this issue 2 years ago • 9 comments

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?

image 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

NikoLXQ avatar Dec 07 '23 07:12 NikoLXQ

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] avatar Dec 07 '23 07:12 getsantry[bot]

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.

hubertdeng123 avatar Dec 09 '23 00:12 hubertdeng123

@Swatinem is probably the right person to answer this.

supervacuus avatar Dec 09 '23 11:12 supervacuus

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 avatar Dec 18 '23 14:12 Swatinem

@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.

hubertdeng123 avatar Jan 11 '24 17:01 hubertdeng123

This can be found here: https://github.com/getsentry/self-hosted/blob/master/.env#L2

hubertdeng123 avatar Jan 11 '24 17:01 hubertdeng123

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.

Swatinem avatar Jan 11 '24 17:01 Swatinem

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

hubertdeng123 avatar Jan 11 '24 17:01 hubertdeng123

Yes, that looks about right to me.

Swatinem avatar Jan 12 '24 08:01 Swatinem