node-problem-detector
node-problem-detector copied to clipboard
add future time filter for log watchers when time across the year
This pr is to fix this specail case:
- kernel log file:
root@:~# tail -n 1 /var/log/messages
Jan 6 02:06:53 kubelet[8137]: E0106 02:06:53.560506 8137 summary_sys_containers.go:89] "Failed to get system container stats" err="failed to get cgroup stats for \"/systemd/system.slice\": failed to get container info for \"/systemd/system.slice\": unknown container \"/systemd/system.slice\"" containerName="/systemd/system.slice"
- journal log:
root@:~# journalctl -u kubelet -n 1
Jan 06 02:07:53 kubelet[8137]: E0106 02:07:53.698973 8137 summary_sys_containers.go:89] "Failed to get system container stats" err="failed to get cgroup stats for \"/systemd/system.slice\": failed to get co>
These logs are not record "year" of time, so when the time from 2025 to 2026, the NPD will think that the log in 2025-12-31 is after than 2026-01-01, so the logs from 2025 will be captured into 2026.