-
Notifications
You must be signed in to change notification settings - Fork 12
feat: Add retention size limit for rotated files #1040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This adds a new flag to the observer command to limit the size of the rotated files. When the rotated files exceed this size, the oldest files are deleted. Signed-off-by: Jakub Sztandera <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new retention size limit feature for rotated files in the observer command. When rotated files exceed the specified size limit, the oldest files are automatically deleted to maintain storage bounds.
Key changes:
- Added
maxRetentionSize
configuration option with CLI flag support - Implemented size-based file cleanup logic that removes oldest files when size limit is exceeded
- Updated file rotation logic to track retained files and their sizes
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
File | Description |
---|---|
observer/options.go | Adds maxRetentionSize field and WithMaxRetentionSize option function |
observer/observer.go | Implements size-based cleanup logic in rotateMessages method |
cmd/f3/observer.go | Adds CLI flag for retention size limit with megabyte conversion |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1040 +/- ##
==========================================
- Coverage 65.34% 64.94% -0.41%
==========================================
Files 80 80
Lines 9702 9733 +31
==========================================
- Hits 6340 6321 -19
- Misses 2867 2910 +43
- Partials 495 502 +7
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High level question: do we feel good about the decision to be writing code to managing retention of files on disk rather than using other standard external tooling for this? (I'm no expert here but I assume this problem isn't unique to us and that there are general solutions that operators apply to prevent too much state from accumulating).
Thinking on this more, I can see why going with doing this within |
Signed-off-by: Jakub Sztandera <[email protected]>
This adds a new flag to the observer command to limit the size of the
rotated files. When the rotated files exceed this size, the oldest files
are deleted.
This is in support of #1041