fix(file source): don't warn about empty files too small to fingerprint#25895
Draft
gaurav0107 wants to merge 1 commit into
Draft
fix(file source): don't warn about empty files too small to fingerprint#25895gaurav0107 wants to merge 1 commit into
gaurav0107 wants to merge 1 commit into
Conversation
Contributor
|
Thank you for your contribution! Before we can merge this PR, please sign our Contributor License Agreement. To sign, copy and post the phrase below as a new comment on this PR.
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
When the `file` source uses the `checksum` fingerprinting strategy, an empty file is too small to fingerprint and previously emitted a "Currently ignoring file too small to fingerprint" warning. Empty files are common and transient (freshly-created log files, short-lived Kubernetes pods), so this flooded operator logs with non-actionable warnings. Suppress the warning for empty (0-byte) files while still emitting it for non-empty files that are too small to fingerprint, since those can genuinely surprise a user wondering why a file isn't being tailed. The retry/cleanup bookkeeping in `known_small_files` is unchanged. Closes: vectordotdev#1065
gaurav0107
force-pushed
the
fix/1065-only-warn-about-small-files-when-they-ar
branch
from
July 19, 2026 23:09
9378144 to
053b0ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When the
filesource uses thechecksumfingerprinting strategy, files that are too small to be fingerprinted trigger aCurrently ignoring file too small to fingerprint.warning. In practice this fires constantly for empty (0-byte) files, which are common and transient in production — for example freshly-created log files or short-lived Kubernetes pods that start and stop quickly. The result is log noise that isn't actionable, which several users have reported on #1065.This change suppresses the warning for empty files while keeping it for non-empty files that are still too small to fingerprint (that case can genuinely surprise a user wondering why a file isn't being tailed). The retry/cleanup bookkeeping in
known_small_filesis unchanged, so empty files are still tracked and picked up once they grow.The fix is confined to
Fingerprinter::fingerprint_or_emitinlib/file-source-common/src/fingerprinter.rs: the file's emptiness is read from the metadata that is already fetched, andemit_file_checksum_failedis skipped when the file is empty.AI assistance disclosure
Per Vector's AI policy: this change was drafted with the assistance of an AI coding agent (model: Claude Opus 4.8). I have read, understood, and locally tested the change, and I own the contribution.
How did you test this PR?
fingerprint_or_emit_only_warns_on_non_empty_small_filesinfingerprinter.rsusing a recording emitter that countsemit_file_checksum_failedcalls. It asserts that an empty file emits no warning and returnsNone, while a non-empty-but-too-small file does emit exactly one warning.cargo test -p file-source-common— 22 passed, 0 failed.cargo fmt -p file-source-common -- --check— clean.cargo clippy -p file-source-common --all-targets— clean.Change Type
Is this a breaking change?
The
checksum_errors_totalmetric still increments for non-empty files that are too small; only the log warning for empty files changes.Does this PR include user facing changes?
no-changeloglabel to this PR.A changelog fragment is included:
changelog.d/1065_file_source_empty_file_warning.fix.md.References
🤖 Opened with Superhuman, an open-source contribution agent.