Info about how PMM evaluate the metrics for a given filesystem

Description:

Metrics usage for a given filesystem.

Hi all, on the pmm dashboard for a given mountpoint i see the values for Free,Used and Usage%

If i extract the metrics about the same filesystem with curl using:
node_filesystem_avail_bytes,
node_filesystem_size_bytes,
node_filesystem_free_bytes

and i calculate free% as 100*[@UsedSize]/([@AvailableSize]+[@UsedSize]) i get a different value than the one calculated on the dashboard.
I know that differs because one should take into account the space reserved for root user.
How can i obtain the same usage% shown on the dashbord using the available metrics?

Steps to Reproduce:

[Step-by-step instructions on how to reproduce the issue, including any specific settings or configurations]

Version:

PMM 2.x

Logs:

[If applicable, include any relevant log files or error messages]

Expected Result:

[What the user expected to see or happen before the issue occurred]

Actual Result:

[What actually happened when the user encountered the issue]

Additional Information:

[Include any additional information that could be helpful to diagnose the issue, such as browser or device information]

Hi, how are you calculating used size though?

node_filesystem_avail_bytes excludes reserved blocks (i.e., only reports space available to non-root users) so you might need something like the one below to match the dashboard:

100 * (1 - free_bytes / size_bytes)

Thank you Michael, i was using free bytes instead than available bytes
Now calculating the free % i’m getting the same values shown on the dashboard,
even though those values are a little different from those shown by df command on the hosts the result is now coherent.