-
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
filelogreceiver tries to read logs from beginning even start_at=end #24839
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I have been unable to replicate the behavior you are describing. Would it be possible to describe a minimal scenario (e.g. set of simple files, simplest possible config, precise steps to follow), or even better, a unit test that fails? |
actually we were having a similar issue.. in our case we had > # of log files than the max_concurrent_files limit, which ended up enabling the batch mode. Looks like when batch is enabled, fromBeginning is enabled In our case in the meantime we WA this by adding a huge limit of concurrent files to avoid batching and that solved the problem. Also I wasn't able to make it work with storage: file_storage. Only when we do not provide a storage for the file position/offset is when it wasn't reading files from start and always just tailing from the end |
Closing as complete, please reopen if the problem still occurs. |
Hi @djaglowski I am still facing this issue despite the fix. From this screenshot you can see: BUNDLE_TIMESTAMP is when the log line was parsed (technically it's when it reached our system, but it's likely just a few seconds earlier) This is how I configured the receiver:
Should I create a new issue or asking here is fine? Thanks |
Component(s)
receiver/filelog
What happened?
Description
I have setup an otel-collector with a log pipeline of filelog receiver and loki exporter. The filelog receiver is set with start_at: end which should read new logs from the moment that the collector is started but it seems only respect this for start_at for the first few log paths but all other log paths are still reading from beginning and it seems also reading without order so the loki exporter returns 'entry too far behind' errror.
Steps to Reproduce
I started to run this collector with a clean loki and no existing checkpoint file.
I have found this timestamp 2022-07-21 14:27:48.808964741 +0000 in one of the old logs before my collector started which should not be read since I set start_at=end.
Also in the collector log, I can see it Started watching file other than Started watching file from end for those logs.
Expected Result
If start_at is end, then the receiver should only read incoming logs from the moment it starts.
Actual Result
It reads old logs.
Collector version
0.82.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
openshift k8s cluster.
OpenTelemetry Collector configuration
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: