[Django]-Sentry delete issues (logs)

9👍

Found a solution here.

In the Sentry Docker directory, run:
docker-compose exec worker bash

After that from the worker bash run:
sentry cleanup --days 15

This will clean up all the events’ data before 15 days.
This took around 5 hours to complete for 500 GB of data.
After cleaning, more than half of the data was deleted.

After this, inside the database run:

docker-compose exec postgres bash

psql -U postgres

\c postgres

VACUUM FULL;

This will lock database tables until the full vacuum operation is done!
Thanks again to the original post for this solution.

UPDATE: 2 weeks since cleaning I received around 5,000,000 errors and the size of the disk is still around 250 GB as was on the day of cleaning. It looks like the workers are doing real cleanups now.

👤SP.

Leave a comment