-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[receiver/filelog] Support option to ignore files older than certain age #31053
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@ycombinator, have you looked into whether |
Thanks @djaglowski. I did look into that option in combination with |
Thanks for confirming @ycombinator. I see the difference and agree it is a sensible feature. I think it would make sense to add it in the |
Pinging code owners for pkg/stanza: @djaglowski. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hello This feature would indeed be very useful. I have been trying to set up a similar behaviour using ordering by date and top_n. It works well enough for now but a way to ignore old files would be better. |
Hi @djaglowski, I'd like to work on this issue if that's okay. [UPDATE] I've put up a PR to try and resolve this issue: #31916. |
…1916) **Description:** This PR implements a new matcher criterion in the Stanza fileconsumer matcher: ``` ExcludeOlderThan time.Duration `mapstructure:"exclude_older_than"` ``` and the corresponding setting in the `filelog` receiver configuration: | Field | Default | Description | |-------------------------------------|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `exclude_older_than` | | Exclude files whose modification time is older than the specified age. | When specified, the matcher will exclude files whose modification times are older than the specified time. **Link to tracking Issue:** #31053 **Testing:** Added unit tests. **Documentation:** Documented `exclude_older_than` configuration setting in the `filelogreceiver`'s README. --------- Co-authored-by: Daniel Jaglowski <[email protected]>
Implemented via #31916 |
…en-telemetry#31916) **Description:** This PR implements a new matcher criterion in the Stanza fileconsumer matcher: ``` ExcludeOlderThan time.Duration `mapstructure:"exclude_older_than"` ``` and the corresponding setting in the `filelog` receiver configuration: | Field | Default | Description | |-------------------------------------|--------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `exclude_older_than` | | Exclude files whose modification time is older than the specified age. | When specified, the matcher will exclude files whose modification times are older than the specified time. **Link to tracking Issue:** open-telemetry#31053 **Testing:** Added unit tests. **Documentation:** Documented `exclude_older_than` configuration setting in the `filelogreceiver`'s README. --------- Co-authored-by: Daniel Jaglowski <[email protected]>
Component(s)
receiver/filelog
Is your feature request related to a problem? Please describe.
For users who keep log files around for long periods of time, it might be useful to tell the
filelog
receiver to only consider files that are younger than a certain age or, in other words, to ignore files that are older than a certain age.Describe the solution you'd like
A new, optional, configuration option for the
filelog
receiver, something likeexclude_older_than
, which accepts a duration as its value.Describe alternatives you've considered
No response
Additional context
Filebeat, Elastic's log shipper, supports such an option in it's
filestream
input, which is conceptually the same as OTel Collector'sfilelog
receiver.The text was updated successfully, but these errors were encountered: