DEV Community

loading...

Clean Sentry On-Premise Database

nixon1333 profile image Ashraful Islam Nixon ・1 min read

So we track our error logs via Sentry on-premises which we hosted on our own. Recently it started to give error, the disk space is running out!!!

WHY??

Apparently we needed to clear the database after certain time. Otherwise it will stack up all of the error logs.

Solution??

We log into our server. Sentry was running in docker. We went to the docker folder ran this
docker-compose exec worker bash
After that from the worker bash we ran
sentry cleanup --days 30
basically this will clean up all the events data before 30 days.

After this we go inside of the database by running these

  • docker-compose exec postgres bash
  • psql -U postgres
  • VACUUM FULL; Point to be noted, VACUUM FULL; will lock your db tables unless the full vacuum is being done.

Voila! Database and hard driver storage cleaned up! :)

Discussion (0)

pic
Editor guide