Improve Disk Monitoring Logic #7421
Open
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.
Issue Addressed
#6687
Proposed Changes
This PR updates which disk is monitored by the system:
datadir
from the client's config (which provides a fallback value if not specified in the command line).datadir
from the command line. If it's not specified,validation_dir
is used as a fallback.Additionally, this PR updates the
Observe
trait by introducing a new method,observe_with_path
, which allows specifying the path to observe. The existingobserve
method, which monitors the root folder, remains unchanged but is now only used byProcessHealth
, as it does not require disk information.Additional Info
While this PR addresses disk usage reporting in many cases, it may be necessary to update the API endpoint to support reporting multiple disks. This would be useful for advanced users who split the database across several disks, as discussed in #6687 (comment).