Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
d815bf0
feat(file-source): Use notify-rs/notify for filesystem notifications
tamer-hassan Apr 4, 2025
9123dfe
refactor(file-source): Move WatcherState import to top of file
tamer-hassan Apr 4, 2025
bc336a4
fix(file-source): Filter notify events to prevent feedback loops
tamer-hassan Apr 4, 2025
9576e98
feat(file-source): Add notify-based file discovery
tamer-hassan Apr 4, 2025
64ac321
feat(file-source): Make file_server more event-driven
tamer-hassan Apr 5, 2025
c9f1a2f
update Cargo.lock
tamer-hassan Apr 8, 2025
fbcd96a
fix code format issues
tamer-hassan Apr 8, 2025
5ba4c78
docs(file-source): Add changelog for notify-based file watching and f…
tamer-hassan Apr 8, 2025
60f6eae
refactor: Make notify-based file discovery the default and remove dea…
tamer-hassan Apr 19, 2025
bf125db
refactor(file-source): Use notification-based watching for all files
tamer-hassan Apr 19, 2025
0cb91f1
docs(changelog): Update file_source_notify changelog for notification…
tamer-hassan Apr 19, 2025
0cdb0e9
Improve file-source responsiveness and efficiency
tamer-hassan Apr 20, 2025
331833b
Update changelog with additional file-source improvements
tamer-hassan Apr 20, 2025
5a65226
Refactor file-source to remove using_notify_discovery flag
tamer-hassan Apr 20, 2025
d0bc9cf
fix(file source): Properly handle file deletion events to prevent rep…
tamer-hassan Apr 20, 2025
438ccd3
chore(file source): Deprecate glob_minimum_cooldown configuration option
tamer-hassan Apr 20, 2025
f6c07e3
fix(file source): Preserve empty lines to maintain compatibility with…
tamer-hassan Apr 20, 2025
431d975
fix: Update file source tests to work with notify-based implementation
tamer-hassan Apr 20, 2025
72292bd
refactor: Remove unused code from file-source
tamer-hassan Apr 21, 2025
634b7aa
feat(sources): Add new ifile source with improved implementation
tamer-hassan Apr 24, 2025
d059dcb
fix: Update ifile-source edition to 2021
tamer-hassan Apr 24, 2025
b8ec08a
add "ifile" to .github/actions/spelling/allow.txt
tamer-hassan Apr 24, 2025
a18105c
fix(ifile source): Skip empty lines at beginning of file during startup
tamer-hassan Apr 24, 2025
5eb30f6
test: Update file_start_position_server_restart_unfinalized test to h…
tamer-hassan Apr 24, 2025
61f6de7
docs(ifile source): Add documentation for ifile source
tamer-hassan Apr 25, 2025
af42c09
Merge upstream/master into file-source-notify branch
tamer-hassan Apr 25, 2025
897c4b8
fix(ifile source): Remove known small files based on remove_after_secs
tamer-hassan Apr 25, 2025
1d279c2
docs(ifile source): changes per review/comments from the docs team
tamer-hassan Apr 30, 2025
b70daac
fix(ifile source): fix code formatting issues
tamer-hassan Apr 30, 2025
7649403
remove leftover println, replace with warn
tamer-hassan May 8, 2025
0f15cd0
fix(ifile source): fix checkevents debug messages to end with dot
tamer-hassan May 10, 2025
66d90fe
rename IFile and ifile back to File and file, respectively
tamer-hassan May 11, 2025
2661c66
refactor: Move shared code to file-source-common library
tamer-hassan May 11, 2025
020a281
define const EXPIRATION_GRACE_DURATION in checkpointer in file-source…
tamer-hassan May 11, 2025
2295d1b
style: Fix formatting issues
tamer-hassan May 11, 2025
ec7f21e
docs: Fix ifile source documentation
tamer-hassan May 11, 2025
21a80d5
docs: Fix ifile source documentation
tamer-hassan May 11, 2025
847c7e1
make file-source-common optional
tamer-hassan May 28, 2025
13f1a8b
docs: add local block device requirement and explanation for ifile so…
tamer-hassan May 28, 2025
4fcf5b4
Merge remote-tracking branch 'origin/master' into file-source-notify
pront Jun 10, 2025
9cc0728
update licenses
pront Jun 10, 2025
60654e7
add dep on file-source-common for optional features files-source and …
tamer-hassan Jun 10, 2025
749b538
Merge branch 'file-source-notify' of https://github.com/tamer-hassan/…
tamer-hassan Jun 10, 2025
fef54ca
fix: Enable file-source-common feature when needed
tamer-hassan Jun 11, 2025
a5687e1
Merge remote-tracking branch 'origin/master' into file-source-notify
thomasqueirozb Jul 29, 2025
679587b
Pull Cargo.lock from master
thomasqueirozb Jul 29, 2025
b8faf0c
Update Cargo.lock
thomasqueirozb Jul 29, 2025
3b2b107
Pull Cargo.lock from master
thomasqueirozb Jul 29, 2025
cff7716
Update Cargo.lock
thomasqueirozb Jul 29, 2025
47d90d8
Merge remote-tracking branch 'origin/master' into file-source-notify
thomasqueirozb Jul 29, 2025
d22b0ae
Remove crate:: prefix
thomasqueirozb Jul 29, 2025
2b18ad1
Remove unused create_gzip_file and allow dead_code for NoErrors
thomasqueirozb Jul 29, 2025
868166f
Use FilePosition instead of u64
thomasqueirozb Jul 29, 2025
4106e4e
Revert test change ordering
thomasqueirozb Jul 29, 2025
4f5a116
Use FilePosition instead of u64
thomasqueirozb Jul 30, 2025
b61a3d0
Use FilePosition
thomasqueirozb Jul 30, 2025
0bd84dc
Update/simplify dependencies, use workspace when possible
thomasqueirozb Jul 30, 2025
c223ce2
Bump criterion
thomasqueirozb Jul 30, 2025
18135ab
Merge remote-tracking branch 'origin/master' into file-source-notify
thomasqueirozb Aug 1, 2025
db51ba0
Fix test
thomasqueirozb Aug 4, 2025
e221dcc
Update Cargo.lock
thomasqueirozb Aug 4, 2025
213976f
Merge remote-tracking branch 'origin/master' into file-source-notify
thomasqueirozb Aug 11, 2025
1663462
Merge remote-tracking branch 'origin/master' into file-source-notify
thomasqueirozb Sep 16, 2025
0a0166c
Make everything async
thomasqueirozb Sep 11, 2025
f8be3c6
Remove experiments
thomasqueirozb Sep 11, 2025
914bf3d
Tests flaky but passing
thomasqueirozb Sep 11, 2025
4ce78f1
Remove infallible path
thomasqueirozb Sep 16, 2025
c44b153
Remove inner useless tokio::spawn
thomasqueirozb Sep 16, 2025
5b1b34b
Remove useless Arc from checkpointer
thomasqueirozb Sep 16, 2025
7481128
Create optional test-only test event channel
thomasqueirozb Sep 16, 2025
91f6b3e
switch tests to tokio
thomasqueirozb Sep 16, 2025
43497d6
Make file_rotate way less flaky
thomasqueirozb Sep 16, 2025
156430d
Add missing flags to test_sender
thomasqueirozb Sep 17, 2025
e0b1325
Remove useless match
thomasqueirozb Sep 17, 2025
05f5aba
Make tests less flaky by using wait_for_n_reads
thomasqueirozb Sep 17, 2025
7fd58d5
Return startup_lines from FileWatcher::new
thomasqueirozb Sep 17, 2025
2d4e941
Send checkpointed test event
thomasqueirozb Sep 17, 2025
1cafe9f
Undo copy paste from resolve symlinks section
thomasqueirozb Sep 22, 2025
6b69279
Remove some dbg! usages
thomasqueirozb Sep 22, 2025
9bdd6b8
Merge remote-tracking branch 'origin/master' into file-source-notify
thomasqueirozb Sep 22, 2025
0b8defa
Fix file_multiple_paths test
thomasqueirozb Sep 22, 2025
e4a2552
Tests very flaky but passing
thomasqueirozb Sep 22, 2025
3696c7b
Add wait_checkpoint_and_n_reads
thomasqueirozb Sep 22, 2025
e4ad88b
Use poll! instead of arbitrary sleep
thomasqueirozb Sep 22, 2025
0d715e7
Remove trace! debug
thomasqueirozb Sep 22, 2025
a60df3c
Make file_start_position_ignore_old_files not flaky
thomasqueirozb Sep 22, 2025
b3cd954
Fix test_oldest_first and test_fair_reads
thomasqueirozb Sep 23, 2025
09e111d
Fix helper and test
thomasqueirozb Sep 23, 2025
6413cb9
Add should_glob to PathProvider::paths
thomasqueirozb Sep 24, 2025
28d9fdb
Use drop for shutdown behavior wherever possible
thomasqueirozb Sep 24, 2025
389d92c
Only emit Checkpointed when a new file is watched
thomasqueirozb Sep 24, 2025
b7f8407
Fix some ifile events to be used in assert_source
thomasqueirozb Sep 24, 2025
664b676
Improve readability
thomasqueirozb Sep 24, 2025
5e15c0e
Improve tests to use test events
thomasqueirozb Sep 24, 2025
ee9d2ff
REVERT ME - debug changes for testing
thomasqueirozb Sep 24, 2025
4a88b52
Further test even fixes
thomasqueirozb Sep 24, 2025
392e2b4
Marginally improve bogus gzip test
thomasqueirozb Sep 24, 2025
cf51059
Remove unused import
thomasqueirozb Sep 24, 2025
e9c254f
Remove bogus emits
thomasqueirozb Sep 24, 2025
2713771
Remove useless clone
thomasqueirozb Sep 24, 2025
8f44d45
Increase timeouts and flush files to make tests pass
thomasqueirozb Sep 24, 2025
ff60166
Make test consistent by using TestEvent
thomasqueirozb Sep 24, 2025
1da5fbb
Fix commented out tests
thomasqueirozb Sep 24, 2025
a512abb
Fix file_start_position_server_restart_unfinalized
thomasqueirozb Sep 25, 2025
83dd1d3
Version bump notify
thomasqueirozb Sep 25, 2025
d0f25fb
Make NotifyWatcher leaner - remove mutex/arc
thomasqueirozb Sep 25, 2025
0cddafb
Use tokio handle instead of futures::executor
thomasqueirozb Sep 25, 2025
f40cd08
Ignore file_duplicate_processing_after_restart
thomasqueirozb Sep 25, 2025
cd5846b
Debug notify slowness
thomasqueirozb Sep 25, 2025
c73f9d5
Remove unused import
thomasqueirozb Sep 25, 2025
5669ac1
Move file creation
thomasqueirozb Sep 25, 2025
87acf8c
Use macos kqueue instead of FsEventWatcher
thomasqueirozb Sep 25, 2025
c04114a
Revert 50s debug timeout change
thomasqueirozb Sep 25, 2025
e98d478
dependency cleanup
thomasqueirozb Sep 25, 2025
76ca2ba
Write checkpoints before shutdown
thomasqueirozb Oct 1, 2025
4463965
Remove glob module
thomasqueirozb Oct 1, 2025
8a167bd
Simplify notify closure
thomasqueirozb Oct 1, 2025
c1d0e05
Don't watch directories recursively when not needed
thomasqueirozb Oct 1, 2025
b90d3dd
Fix counters/metrics
thomasqueirozb Oct 1, 2025
0ebc2f1
Make checkpoint interval ms
thomasqueirozb Oct 1, 2025
c38d244
Make tests pass with sleep
thomasqueirozb Oct 1, 2025
6dc8697
Merge branch 'master' into file-source-notify
thomasqueirozb Oct 10, 2025
913a9cc
Fix incorrect cfg
thomasqueirozb Oct 10, 2025
72eb1c0
Fix compilation issues
thomasqueirozb Oct 10, 2025
36aca34
Make test_sender required
thomasqueirozb Oct 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ Ideapad
idn
ifeq
ifneq
ifile
imobile
Infinix
influxd
Expand Down
91 changes: 82 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ members = [
"lib/fakedata",
"lib/file-source",
"lib/file-source-common",
"lib/ifile-source",
"lib/k8s-e2e-tests",
"lib/k8s-test-framework",
"lib/loki-logproto",
Expand Down Expand Up @@ -596,6 +597,7 @@ sources-logs = [
"sources-docker_logs",
"sources-exec",
"sources-file",
"sources-ifile",
"sources-fluent",
"sources-gcp_pubsub",
"sources-heroku_logs",
Expand Down Expand Up @@ -649,7 +651,8 @@ sources-dnstap = ["sources-utils-net-tcp", "dep:base64", "dep:hickory-proto", "d
sources-docker_logs = ["docker"]
sources-eventstoredb_metrics = []
sources-exec = []
sources-file = ["vector-lib/file-source"]
sources-file = ["vector-lib/file-source", "vector-lib/file-source-common"]
sources-ifile = ["vector-lib/ifile-source", "vector-lib/file-source-common"]
sources-file_descriptor = ["tokio-util/io"]
sources-fluent = ["dep:base64", "sources-utils-net-tcp", "sources-utils-net-unix", "tokio-util/net", "dep:rmpv", "dep:rmp-serde", "dep:serde_bytes"]
sources-gcp_pubsub = ["gcp", "dep:h2", "dep:prost", "dep:prost-types", "protobuf-build", "dep:tonic"]
Expand All @@ -662,7 +665,7 @@ sources-internal_metrics = []
sources-static_metrics = []
sources-journald = []
sources-kafka = ["dep:rdkafka"]
sources-kubernetes_logs = ["vector-lib/file-source", "kubernetes", "transforms-reduce"]
sources-kubernetes_logs = ["vector-lib/file-source", "vector-lib/file-source-common", "kubernetes", "transforms-reduce"]
sources-logstash = ["sources-utils-net-tcp", "tokio-util/net"]
sources-mongodb_metrics = ["dep:mongodb"]
sources-mqtt = ["dep:rumqttc"]
Expand Down
17 changes: 17 additions & 0 deletions changelog.d/22803_ifile_source.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
A new `ifile` source has been added as an improved version of the `file` source. The `ifile` source is a complete rewrite that addresses several limitations of the original implementation while maintaining compatibility with existing configurations.

Key improvements in the `ifile` source:

- **Fully async implementation**: Uses async/await throughout for better performance and resource utilization
- **Cross-platform filesystem notifications**: Uses the notify-rs library to detect file changes through OS-level notifications instead of polling
- **Improved file discovery**: Detects new files within milliseconds using filesystem notifications instead of periodic globbing. Only globs once on startup for initial discovery, and therefore obsoletes and removes the `glob_minimum_cooldown_ms` option
- **Resource efficiency**: Never keeps file handles open for idle files, only opening them when needed for reading
- **Better shutdown behavior**: Properly handles shutdown signals and gracefully closes all resources
- **Improved checkpointing**: Introduces a new `checkpoint_interval` configuration option
- **Startup consistency**: Reads files at startup to detect changes that occurred while Vector was stopped
- **Intelligent throttling**: Optimizes CPU usage and log verbosity with smart event handling
- **Better error handling**: Properly handles file deletion events to prevent repeated error messages

The original `file` source remains unchanged and fully supported. Users can migrate to the `ifile` source at their convenience to take advantage of these improvements.

authors: tamer-hassan
Loading
Loading