You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current DiskUsage health check backend hardcodes the monitored path as /. This works fine when running natively. However, within a Docker container, it checks the container's root filesystem, and not the host's.
This makes the health check less useful in containerized environments, as it doesn't reflect the actual disk usage of the underlying host.
Suggestion
To enable monitoring the host's disk usage from within a container, a possible approach is to:
Allow configuration of the disk usage path via a setting (e.g., HEALTH_CHECK['DISK_USAGE_PATH']).
If HEALTH_CHECK['DISK_USAGE_PATH'] is set, use that path for psutil.disk_usage(). Otherwise, default to / for backward compatibility and non-containerized environments.
This would allow users to mount the host's filesystem to a specific path within the container (e.g., /host/) and then configure HEALTH_CHECK['DISK_USAGE_PATH'] to /host/ to monitor the correct disk usage.
This is the approach used by other monitoring solutions such as Prometheus' node_exporter
Happy to send a PR if you agree with the approach.
The text was updated successfully, but these errors were encountered:
Description
The current
DiskUsage
health check backend hardcodes the monitored path as/
. This works fine when running natively. However, within a Docker container, it checks the container's root filesystem, and not the host's.This makes the health check less useful in containerized environments, as it doesn't reflect the actual disk usage of the underlying host.
Suggestion
To enable monitoring the host's disk usage from within a container, a possible approach is to:
HEALTH_CHECK['DISK_USAGE_PATH']
).HEALTH_CHECK['DISK_USAGE_PATH']
is set, use that path forpsutil.disk_usage()
. Otherwise, default to/
for backward compatibility and non-containerized environments.This would allow users to mount the host's filesystem to a specific path within the container (e.g.,
/host/
) and then configureHEALTH_CHECK['DISK_USAGE_PATH']
to/host/
to monitor the correct disk usage.This is the approach used by other monitoring solutions such as Prometheus' node_exporter
Happy to send a PR if you agree with the approach.
The text was updated successfully, but these errors were encountered: