-
Notifications
You must be signed in to change notification settings - Fork 3.1k
[pkg/stanza] log when files are rotated/moved/truncated #33237
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
08f16a6 to
b7343dd
Compare
b7343dd to
147044a
Compare
147044a to
8716076
Compare
djaglowski
left a comment
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.
Should we add actual test cases to make sure we don't regress? We could use zaptest/observer to validated the expected logs.
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.
I suppose it doesn't technically matter but do you think it would be slightly more readable to use oldReader here, simply because we are communicating to the reader about the old file that is no longer here?
8716076 to
1f74fee
Compare
pkg/stanza/fileconsumer/design.md
Outdated
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.
Good explainations. Can I suggest we reverse the order so that we start with the simplest case (move/create within pattern) and progress to the most complex (copy/truncate out of pattern)?
pkg/stanza/fileconsumer/design.md
Outdated
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.
Here as well, I think move/create is simpler to understand since copy/truncate comes with a possible data loss scenario.
a698bda to
5bd7b4d
Compare
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
Signed-off-by: ChrsMark <[email protected]>
5bd7b4d to
78f738a
Compare
Description:
This PR adds the logging part from #31256.
With this addition every time that is identified that file is rotated
either by move/create or copy/truncate, proper logging takes place.
Link to tracking Issue: #31256
Testing:
Updated existing unit tests
How to test this manually
Using the following config:
Testing truncate (out of pattern)
Testing truncate (in pattern)
Testing move/create (out of pattern)
Testing move/create (in pattern)
Documentation:
Add some extra notes in the
design.md