Skip to content

Point Grafana disk-usage panels at the real DOCKER_ROOT mountpoint - #2738

Merged
yorickdowne merged 3 commits into
ethstaker:mainfrom
cpi3t:grafana-disk-usage-mountpoint
Aug 4, 2026
Merged

Point Grafana disk-usage panels at the real DOCKER_ROOT mountpoint#2738
yorickdowne merged 3 commits into
ethstaker:mainfrom
cpi3t:grafana-disk-usage-mountpoint

Conversation

@cpi3t

@cpi3t cpi3t commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

What I did

Grafana's "Host & Docker Monitoring" dashboard (id 15120) hard-codes
mountpoint="/" in its Root FS / disk-usage panels ("Root FS Used",
"RootFS Total", "Used Disk Space"). On installs where DOCKER_ROOT lives
on its own filesystem (e.g. /srv/docker), these panels always reported
the root filesystem's usage instead of the filesystem that actually
holds Docker's data.

  • Added a DOCKER_ROOT_MOUNTPOINT var to default.env, detected by ethd
    via findmnt/df (same pattern already used in __optimize_host),
    right after the existing DOCKER_ROOT detection in __handle_docker.
  • Passed it through to the grafana container via grafana.yml.
  • Added a fix_docker_mountpoint helper in grafana/provision.sh that
    rewrites mountpoint="/" to the real mountpoint in dashboard 15120's
    JSON via jq.
  • Other dashboards with cAdvisor/host metrics (19724) or the home
    staking dashboard (17846) don't hard-code a mountpoint filter, so
    they're left untouched.
  • No-op when DOCKER_ROOT is on / (the default, and by far the most
    common setup) — verified the JSON output is byte-for-byte identical
    in that case.

Manually tested:

  • Default setup (DOCKER_ROOT_MOUNTPOINT=/): dashboard unchanged.
  • Simulated separate mount (DOCKER_ROOT_MOUNTPOINT=/srv/docker):
    confirmed via jq against the live dashboard 15120 JSON that both
    mountpoint="/",fstype!="rootfs" and fstype!="rootfs",mountpoint="/"
    orderings get rewritten correctly and output stays valid JSON.
  • Verified ethd update's existing .env migration path places the new
    var at the same position as in default.env (right after
    DOCKER_ROOT), not appended at the end — this requires the
    ENV_VERSION bump included here.
  • shellcheck ethd grafana/provision.sh clean (no new findings).

Related issue

None filed — found while investigating Grafana disk-usage reporting on
a host with DOCKER_ROOT on a separate mount.

Grafana's "Host & Docker Monitoring" dashboard (id 15120) hard-codes
mountpoint="/" in its Root FS / disk-usage panels, so installs with
DOCKER_ROOT on a separate filesystem (e.g. /srv/docker) never see disk
usage for that partition.

ethd already detects DOCKER_ROOT via `docker system info`, but not the
real mountpoint backing it. This adds DOCKER_ROOT_MOUNTPOINT, detected
via findmnt/df (same pattern already used in __optimize_host), passed
through to the grafana container, and used by a new
fix_docker_mountpoint helper in provision.sh to rewrite mountpoint="/"
in the one dashboard that actually hard-codes it. No-op when
DOCKER_ROOT is on "/", which is the default and most common case.
@yorickdowne
yorickdowne self-requested a review August 4, 2026 05:02
Comment thread grafana/provision.sh Outdated
Comment thread grafana/provision.sh Outdated
Co-authored-by: Yorick Downe <71337066+yorickdowne@users.noreply.github.com>
@yorickdowne
yorickdowne merged commit 17b1a7b into ethstaker:main Aug 4, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants