[pkg/stanza] Functionality to delete files once processed #16314
Labels
enhancement
New feature or request
needs triage
New item requiring triage
pkg/stanza
receiver/filelog
Component(s)
pkg/stanza, receiver/filelog
Is your feature request related to a problem? Please describe.
One use case that has come up is the ability to specify to the receiver that once a file has been fully read and processed by the collector that it should be removed from the host system.
Some users would argue that this feature would greatly increase usage of the
filelogreceiver
in environments that are either sensitive to disk size or desire not to keep log data on a host once its been exported by their preferred exporter.Specifically one of the user stories that is attempting to be addressed here is to read & process hundreds of compressed log files from a designated directory, with each of them being deleted after the read is complete.
Describe the solution you'd like
Some way for specifying to the
fileconsumer.Config
that once we are done with a file, the consumer will delete the file.By default this behavior should be disabled.
So something akin to:
Describe alternatives you've considered
One thing that is somewhat is an anti-pattern is that this is actively modifying the host environment of the collector which is something that usually should be avoided.
Other alternative parameters is to emulate what is available for K8s cron-jobs and employ some type of parameter that is like
ttl_seconds_after_finished
where if a file has no new entries within a certain amount of seconds it can be deleted.Would love for more discussions on how to solve this user case but wanted to get the discussion going on how we could potentially solve this use case using open-telemetry.
Additional context
As of submitting this, mostly wanted to gather thoughts about what would be a correct way of solving this problem. Not proposing that this would be the final solution.
The text was updated successfully, but these errors were encountered: