Skip to content

Support a configurable retention policy#446

Merged
oxzi merged 1 commit into
mainfrom
retention
Jul 1, 2026
Merged

Support a configurable retention policy#446
oxzi merged 1 commit into
mainfrom
retention

Conversation

@yhabteab

@yhabteab yhabteab commented Jun 22, 2026

Copy link
Copy Markdown
Member

This PR adds a configurable retention policy to periodically cleanup historical data. It's designed to be as generic as possible to support all kind of tables (e.g. we might also want to purge all entries from everywhere marked as deleted = y in the future) even though we only need this for the incident and all its related tables right now. It's similar to Icinga DB's retention policy but not necessarily the same, so I didn't try to deduplicate it into IGL.

resolves #393
resolves #391

@yhabteab yhabteab added this to the 1.0 milestone Jun 22, 2026
@yhabteab yhabteab requested a review from oxzi June 22, 2026 09:33
@yhabteab

Copy link
Copy Markdown
Member Author

@cla-bot check

@cla-bot cla-bot Bot added the cla/signed CLA is signed by all contributors of a PR label Jun 22, 2026
Comment thread doc/03-Configuration.md Outdated
Comment thread doc/03-Configuration.md Outdated
Comment thread internal/retention/prune.go
Comment thread internal/retention/retention.go Outdated
Comment thread internal/retention/retention.go Outdated
Comment thread doc/03-Configuration.md
Comment thread cmd/icinga-notifications/main.go
Comment thread internal/retention/retention.go
@yhabteab

Copy link
Copy Markdown
Member Author

Addressed all your requested changes and also added an index for the recovered_at column on the incident table.

@yhabteab

Copy link
Copy Markdown
Member Author

Just rebased it to get the latest changes from the main branch.

@oxzi oxzi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, this PR looks fine - just two small things. Nevertheless, I have successfully tested this PR branch with a working retention configuration.

Comment thread doc/03-Configuration.md Outdated
Comment thread internal/retention/prune.go Outdated
Comment thread internal/retention/retention.go
@yhabteab yhabteab requested a review from oxzi July 1, 2026 08:47
@oxzi oxzi enabled auto-merge July 1, 2026 09:00
@oxzi oxzi merged commit d84c896 into main Jul 1, 2026
26 checks passed
@oxzi oxzi deleted the retention branch July 1, 2026 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed CLA is signed by all contributors of a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support a configurable retention policy for closed incidents Reduce data persistence to an absolute minimum

2 participants