loki.source.docker: positions removed on transient docker error #5797
Labels
bug
Something isn't working
frozen-due-to-age
Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
What's wrong?
When a transient docker error occurs the position will be removed from the positions file leading to the agent re-ingesting the docker logs from the beginning.
According to this comment the position is removed from the file if it is missing from the "new targets".
This function is called from here where the targets are being created based on the target input - the targets array is filled within the loop where we call syncTargets as well. This obviously causes the targets in syncTargets to be incomplete and therefore cause the targets to be deregistered - and restarts the entire log ingestion as this automatically resets the position file.
I would expect that this line should instead be called after the for loop - when the targets slice is fully populated.
Steps to reproduce
Unclear how to reproduce. Also not entirely sure why this was never reported as a bug as I would expect that anybody using the docker source would have to experience this issue of regular restarts of the docker log ingestion.
System information
No response
Software version
at leat from v0.37.1
Configuration
No response
Logs
The text was updated successfully, but these errors were encountered: