From ecf28a3da7e702ff197a5d6c9846287713a76f90 Mon Sep 17 00:00:00 2001 From: MOZGIII Date: Tue, 23 Jun 2020 10:44:01 +0300 Subject: [PATCH] Switch fingerprinter to checksum Signed-off-by: MOZGIII --- src/sources/kubernetes_logs/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/sources/kubernetes_logs/mod.rs b/src/sources/kubernetes_logs/mod.rs index 6e2cb0ca5d53b..55292569c1dd2 100644 --- a/src/sources/kubernetes_logs/mod.rs +++ b/src/sources/kubernetes_logs/mod.rs @@ -197,11 +197,12 @@ impl Source { max_line_bytes: 32 * 1024, // 32 KiB data_dir, glob_minimum_cooldown: Duration::from_secs(10), - // Use device inodes for fingerprinting. - // - Docker recreates files on rotation: https://github.com/moby/moby/blob/75d655320e2a443185f8fa4992dc89bd2da0ea68/daemon/logger/loggerutils/logfile.go#L182-L222 - // - CRI-O recreates files on rotation: https://github.com/cri-o/cri-o/blob/ad83d2a35a30b8a336b16a0ea5f7afc6aebfb9b7/internal/oci/runtime_oci.go#L988-L1042 - // The rest should do the same. - fingerprinter: Fingerprinter::DevInode, + fingerprinter: Fingerprinter::Checksum { + // This value is based on the smallest meaningful log file size, + // taking into account Docker and CRI log formats. + fingerprint_bytes: 40, + ignored_header_bytes: 0, + }, oldest_first: false, };