-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(remap transform): make --watch-config
watch external VRL files in remap
transforms
#23010
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
0ea7f5e
to
52f5547
Compare
Invoke the `files_to_watch` function for applicable transforms to collect external file paths that should be watched for changes.
Add a `files_to_watch` function to the remap transform to collect file paths from the `file` and `files` fields. This allows to watch these files for changes and trigger reloads when the VRL code is modified.
…config` enabled Relative paths to external files in the configuration are now correctly resolved when using --watch-config. Previously, changes to such files not trigger a reload if the path provided in the config was relative. This fix ensures that relative paths are canonicalized, allowing file changes to be properly detected.
Any updates on this PR? |
@pront |
Looks great now. Did you repeat the reload tests with these changes? |
Yes, I verified that the transform component reloads correctly when external VRL files specified via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @nekorro. This was a highly requested enhancement!
Summary
This change ensures that updates to VRL source code are respected when calculating configuration diffs. External VRL files referenced in remap transforms (via file or files fields) are now tracked when
--watch-config
is enabled, allowing Vector to reload the configuration automatically when these files change.Change Type
Is this a breaking change?
How did you test this PR?
Test file field
Added a remap transform to config/vector.yaml :
Started Vector with

vector -vvv -c config/vector.yaml -w
Then, modified the
/vector/vrl/vrl_one
file.Vector detected the change and reloaded the configuration automatically as expected.
Test files field
Added a remap transform to config/vector.yaml :
Started Vector with

vector -vvv -c config/vector.yaml -w
Then, modified the
/vector/vrl/vrl_two
file.Vector detected the change and reloaded the configuration automatically as expected.
Does this PR include user facing changes?
Notes
@vectordotdev/vector
to reach out to us regarding this PR.pre-push
hook, please see this template.cargo fmt --all
cargo clippy --workspace --all-targets -- -D warnings
cargo nextest run --workspace
(alternatively, you can runcargo test --all
)./scripts/check_changelog_fragments.sh
git merge origin master
andgit push
.Cargo.lock
), pleaserun
cargo vdev build licenses
to regenerate the license inventory and commit the changes (if any). More details here.References