Repeating what I said before, I would do it by adjusting the alerting expr to return the actual amount of free space in bytes:
- alert: LowDiskSpace
expr: windows_logical_disk_free_bytes and ((windows_logical_disk_free_bytes{volume="C:"} / windows_logical_disk_size_bytes) * 100) <= 10
for: 1m
labels:
severity: warning
annotations:
summary: "10% C-Disk Space"
description: "Das C-Volumen des Hosts {{ $labels.instance }} ist noch 10% frei ({{$value | humanize}})."
- alert: LowDiskSpace
expr: windows_logical_disk_free_bytes and ((windows_logical_disk_free_bytes{volume="C:"} / windows_logical_disk_size_bytes) * 100) <= 5
for: 1m
labels:
severity: critical
annotations:
summary: "5% C-Disk Space"
description: "Das C-Volumen des Hosts {{ $labels.instance }} ist noch 5% frei ({{$value | humanize}})."
Since the percentage is never returned as part of the query, I would also simplify the expression to remove the factor of 100.
expr: windows_logical_disk_free_bytes and (windows_logical_disk_free_bytes{volume="C:"} / windows_logical_disk_size_bytes) < 0.1
Note: you can simply enter the entire "expr" into the PromQL browser in the Prometheus web interface to test it. If it returns one or more values, that means an alert condition is active. You'll also be able to see the values and labels returned by the alerting expression. I have tested with the following expression:
node_filesystem_avail_bytes and node_filesystem_avail_bytes / node_filesystem_size_bytes < 0.7