Skip to content

Conversation

@thiagoftsm
Copy link
Contributor

@thiagoftsm thiagoftsm commented Sep 26, 2025

Summary

The current windows.plugin cannot accurately detect space usage on small devices because it collects data in GiB instead of the MiB unit typically expected for partitions like EFI.

In addition to this initial issue, data collected from PerfLib updates slowly and does not accurately reflect the current used and free space on devices.

Finally, Netdata is labeling mount points that do not exist.

Master Branch:
master

This Branch:
PR

Test Plan
  1. Compile master branch, generate installer and install it. Check disk.usage
  2. Compile this branch, generate installer and install it. Check disk.usage
Additional Information
For users: How does this change affect me?

@github-actions github-actions bot added area/collectors Everything related to data collection collectors/windows labels Sep 26, 2025
@github-actions github-actions bot added the area/metadata Integrations metadata label Sep 29, 2025
@thiagoftsm thiagoftsm requested a review from stelfrag September 29, 2025 02:44
@thiagoftsm thiagoftsm marked this pull request as ready for review September 29, 2025 02:44
@github-actions github-actions bot removed the area/metadata Integrations metadata label Sep 29, 2025
@thiagoftsm thiagoftsm requested a review from ilyam8 September 29, 2025 17:10
Comment on lines 187 to +188
// Assume it's a Volume GUID path or a device path
snprintf(pathBuffer, sizeof(pathBuffer), "\\\\.\\%s\\", diskName); // Format as "\\.\HarddiskVolume1\"
snprintf(pathBuffer, sizeof(pathBuffer), "%s", diskName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Why this change? Was \\\\.\\%s\\ wrong? What was wrong?
  • You posted 2 screenshots. We can see on the 2nd (this branch) screenshort that the mount_point label value is changed from HarddiskVolumeX to [unset]. Is that expected? Your PR description doesn't have any info about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change? Was \\.\%s\ wrong? What was wrong?

Now that we are using FindFirstVolumeA, we receive the volume's full path. The Microsoft path format for a volume is:

\\?\Volume{GUID} 

You posted 2 screenshots. We can see on the 2nd (this branch) screenshort that the mount_point label value is changed from HarddiskVolumeX to [unset]. Is that expected? Your PR description doesn't have any info about it.

There is no mount point with this name (HarddiskVolumeX) on Windows. Microsoft mount points are named as drive letters (e.g., C:\). The original code was displaying a name that does not correspond to any visible location.

If you wish, I can modify the code to use the same names displayed in Disk Management. This would provide users with a recognizable name instead of an invisible one.

Screenshot 2025-09-29 232031

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not mounted, but we need the label value. Can you check node_exporter? What label values does it have?

@thiagoftsm thiagoftsm marked this pull request as draft September 30, 2025 18:50
@thiagoftsm
Copy link
Contributor Author

Part of the issues this PR was meant to address have already been fixed in another PR. Therefore, I am closing this one and will handle the labels in a separate, independent PR.

@thiagoftsm thiagoftsm closed this Oct 4, 2025
@thiagoftsm thiagoftsm deleted the address_disk_space branch October 4, 2025 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/collectors Everything related to data collection collectors/windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants