-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
tail channel closed, stopping tailer #6503
Comments
Hi @yangvipguang. I think this occurring when your file is rotated. |
This might be a known issue. I'll take a look. |
@dannykopping yes, the node log files are rotated 。 |
@yangvipguang are you actually missing logs when this occurs, or are you just asking about the error in the logs? This looks like good behaviour because when a file it rotated it will be renamed (but still maintain the same |
@dannykopping yes actually missing logs when the log is rolated |
It appears Promtail really only tracks the positions based on the filename
and only recognizes the rotation of a file if it's actively running and watching during the rotation: This is how this is logged:
Certainly Promtail tries to read the remaining data from the just "deleted" (actually moved) file, but what happens when that fails or does not finish until Promtail is stopped? There is documenation on how Promtail behaves in case the file was truncated (or replaced by a new file of the same name during logroation): https://github.com/grafana/loki/blob/main/docs/sources/clients/promtail/troubleshooting.md#a-tailed-file-is-truncated-while-promtail-is-not-running= There it's clearly stated that if the new file was already bigger than the last position saved for this file (by name) there is data loss (as in "not shipped" to Loki) as there is no way to reconcile. Last but not least, using the inodes would also remove the current issue of the wildcard file pattern causing double (or multiple) ingests of the "same" file / data as described in: #3655, but make this a feature: If the inode was used to identify each file a rotated away file could also be resumed to be read from, just like Elastic documents for their Filebeat shipper: https://www.elastic.co/guide/en/beats/filebeat/current/file-log-rotation.html#file-log-rotation |
@dannykopping would you potentially be open to discuss adding inode as a key to Promtail file tailing to avoid the known and documented issues with logroation? |
the following may be relevant: #8039 (comment) |
Describe the bug
![image](https://user-images.githubusercontent.com/11416887/175890404-cee73ddf-ad1b-4d39-a56d-dfdfb8fe3ed4.png)
![image](https://user-images.githubusercontent.com/11416887/175890608-9c2573ab-12ee-437b-bfc0-75189259f146.png)
A clear and concise description of what the bug is.
Promtail often fails to read logs. log error:
Restart promtail and return to normal
Version: 2.5.0
Platform: Centos7
The text was updated successfully, but these errors were encountered: