ROX-30836: implement hotreloading configuration for outputs#119
Merged
ROX-30836: implement hotreloading configuration for outputs#119
Conversation
Contributor
Author
|
/retest |
1 similar comment
Contributor
Author
|
/retest |
Stringy
approved these changes
Oct 23, 2025
Contributor
Stringy
left a comment
There was a problem hiding this comment.
Couple of nits but nothing major
| } | ||
| } | ||
|
|
||
| pub(super) fn is_active(&self) -> bool { |
Contributor
There was a problem hiding this comment.
[nit] is_active implies to me that there is a connection -- perhaps is_enabled?
a75dddc to
642301c
Compare
With this patch, it is possible to reload the configuration used for gRPC communication. Allowing changes to the certificate directory or output URL to be done without a full restart being required. The output code has also been slightly refactored, the module now has a single start function that will spawn a task for gRPC output and another for JSON to stdout (if this is required at start up or the gRPC output is not configured). Both the gRPC and stdout code now live as submodules of the output module. The stdout output is meant mostly for debugging, so hotreloading was not implemented for it. Lastly, there used to be a task that would receive `Arc<Event>` messages from the BPF worker, translate them to the `FileActivity` type and forward them out a separate channel that ultimately was the gRPC stream, this whole workflow has now been replaced by a filter_map operation that does the translating on the gRPC stream directly, leading to more concise code.
642301c to
5b2adad
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.
Description
With this patch, it is possible to reload the configuration used for gRPC communication. Allowing changes to the certificate directory or output URL to be done without a full restart being required.
The output code has also been slightly refactored, the module now has a single start function that will spawn a task for gRPC output and another for JSON to stdout (if this is required at start up or the gRPC output is not configured).
Both the gRPC and stdout code now live as submodules of the output module.
The stdout output is meant mostly for debugging, so hotreloading was not implemented for it.
Lastly, there used to be a task that would receive
Arc<Event>messages from the BPF worker, translate them to theFileActivitytype and forward them out a separate channel that ultimately was the gRPC stream, this whole workflow has now been replaced by a filter_map operation that does the translating on the gRPC stream directly, leading to more concise code.I don't expect the URL reloading to be particularly useful but, when we inevitable get asked to have certificate hot reloading, this will make the required change trivial (simply trigger a gRPC configuration reloading when the certificate files change).
Checklist
Automated testing
If any of these don't apply, please comment below.
Testing Performed
Manually tested with the mock-server + added integration test.