Purge Event Table for Runbook Events

Hi,
according to your Infrastructure Performance page, it is not possible to apply a retension policy on the Events table.

We started in February this year with Runbooks and use them to execute tasks on Azure SQL databases.
Our Events table as over 3 million rows and its oldest records are from 2016.

We have runbooks running once per minute for multiple projects, tenants and environments.
Could you please provide a way to remove these entries?

Kind regards,
Michael

Hi @MichaelM!

Thanks for reaching out, and for the great question. In designing Runbooks, we knew that they would be used frequently, so they were built to only keep 100 runs per environment by default. In 2020.3, we also introduced this as a configurable retention policy, allowing you to adjust this value on a per-runbook basis.

In regards to your events table being large, as it contains all of the historic audit information for every action Octopus takes, it can grow quite large over time. If you haven’t already, implementing Retention policies on your lifecycles can help clean up some of these entries.

While we don’t recommend manual manipulation of the database, you can prune this yourself with SQL queries (either pruning everything before a date, or selectively pruning based on the type of event (which retains the audit log for the important events)) to help clean this up. If you do wish to go down this avenue, backing the entries up to a different database that can be referenced/restored as needed would be a good idea.

I hope this helps!

Hi Justin,
thank you for your fast response.
We have retension policies in place for all lifecycles and are currently on v2020.2.10.
If I understand it correctly, the retension policy has no affect on the history audit information in the events table. This means v2020.3 would not help here.

It would be great to be able to archive parts of the audit history and to delete the archived entries from the events table.

We will come back to you if we decide to delete data from the database.
We need to be sure, there is no problem with the following updates after manipulating the database on sql basis.

Kind regards,
Michael

If it’s just removing older entries from the events table, there shouldn’t be any issues with future upgrades at this time.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.