ROX-33197: implement periodic scanning of host paths#329
Open
ROX-33197: implement periodic scanning of host paths#329
Conversation
The purpose of this scan is to mitigate any inconsistencies in the inode tracking we might get from missed events on the kernel and will also update the maps on a configuration change. The existing scan method is extended to first cleanup any items that are no longer monitored or don't exist anymore on the host, then directories that are to be monitored are scanned and the inode maps are populated from the files found. The scan interval is set to 30 seconds by default, but can be modified through the regular configuration methods (file, env var, CLI arg). Unit tests for parsing of this new configuration value have been added. Some basic metrics have been added to the host_scanner module, these will keep track of: - Events coming through that get their host path filled in. - Elements being updated/removed during a scan. Finally, some integration tests that changed the monitored path are fixed. With these changes, the scanning of new monitored paths are causing the host path on those tests to be populated correctly, showing the scan works as expected.
0bc9f14 to
44d6f8f
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
The purpose of this scan is to mitigate any inconsistencies in the inode tracking we might get from missed events on the kernel and will also update the maps on a configuration change. The existing scan method is extended to first cleanup any items that are no longer monitored or don't exist anymore on the host, then directories that are to be monitored are scanned and the inode maps are populated from the files found.
The scan interval is set to 30 seconds by default, but can be modified through the regular configuration methods (file, env var, CLI arg). Unit tests for parsing of this new configuration value have been added.
Some basic metrics have been added to the host_scanner module, these will keep track of:
Finally, some integration tests that changed the monitored path are fixed. With these changes, the scanning of new monitored paths are causing the host path on those tests to be populated correctly, showing the scan works as expected.
Checklist
Automated testing
If any of these don't apply, please comment below.
Testing Performed
Manually tested locally.