How to cleanup all the transactions collected for performance measure?

I got a disk full error and the root cause is Postgres has occupied most space because we enabled traces with

traces_sample_rate = 0.5

Performance monitoring is not that important at this moment. Anybody know how to to trim data related to traces/transactions?

@fpacifici @lynnagara any ideas?


@BYK If the issue is a postgres disk full, this is data in nodestore. Like Snuba nodestore has a TTL, but I assume we cannot wait for that.
@lynnagara do you remember if we have some script on sentry to trigger the nodestore TTL (I remember you made changes to that area when working on eventstore). Though that would delete everything from nodestore, not only transactions.

@amitsavani I would assume your goal is to only delete transactions and that you also have other event types you want to preserve. Is this correct ?
So there is no specific “delete all transactions” feature. So a few options:

  • Knowing those transactions will have a TTL (90 days). Is it an option to tune traces_sample_rate down, add more disk to postgres till then and wait for them to go away?
  • if not, can you afford wiping all events including errors?
  • if not I think we can give you instructions on how to write a simple script to remove all events of transactions type

We don’t have any easy way to delete only transactions right now. You can run sentry cleanup with any --days value but this will delete everything older than that not just transactions.

If you wanted to target transactions only, you’d probably have to query Snuba for the IDs of the transaction events and use those IDs to figure out which rows to delete from the nodestore table.