disk_usage_exporter icon indicating copy to clipboard operation
disk_usage_exporter copied to clipboard

Wrong values for disk usage on windows

Open w00dst0ck opened this issue 2 years ago • 1 comments

I've compiled your exporter on windows with go build and it compiled without any error. Also it's possible to execute the resulting binary disk_usage_exporter.exe.

E:\disk_usage_exporter-0.4.0>disk_usage_exporter.exe -m file -p z:\
time="2023-09-13T10:48:10+02:00" level=info msg="Disk Usage Prometheus Exporter <<< filled in by build >>>\tbuild date: <<< filled in by build >>>\tsha1: <<< filled in by build >>>\tGo: go1.21.1\tGOOS: windows\tGOARCH: amd64"
time="2023-09-13T10:48:18+02:00" level=info msg="Analysis done"
time="2023-09-13T10:48:19+02:00" level=info msg="Stored stats in file ./disk-usage-exporter.prom"
time="2023-09-13T10:48:19+02:00" level=info msg="Done - exiting."

However, the directory and file sizes in the output do not match the real sizes in the file system.

# TYPE node_disk_usage_level_1_bytes gauge
node_disk_usage_level_1_bytes{path="e:\\Install"} 12288
node_disk_usage_level_1_bytes{path="e:\\temp"} 1.3725696e+07

image image

w00dst0ck avatar Sep 13 '23 09:09 w00dst0ck

As a supplement. Files are returned with the size 0.

node_disk_usage_bytes{path="c:\\temp\\disk_usage_exporter-0.4.0\\LICENSE"} 0
node_disk_usage_bytes{path="c:\\temp\\disk_usage_exporter-0.4.0\\Makefile"} 0
node_disk_usage_bytes{path="c:\\temp\\disk_usage_exporter-0.4.0\\README.md"} 0

w00dst0ck avatar Sep 13 '23 12:09 w00dst0ck