Core Compute Platform

Send us your best ideas, we want to hear them! If you need help with anything regarding your DigitalOcean account, please open a ticket with our Support team through https://cloudsupport.digitalocean.com/s/
Fix duplicate filesystem metrics on Kubernetes and CageFS- #368
dedup on the exported label tuple instead of the full struct. https://github.com/digitalocean/do-agent/pull/368 Support ticket #12093409 (created April 28, 2026) invited me to post this idea to fix this bug on the Core Compute Platform (ref: !00Df2018t5m.!500QP01QvKFR:ref) on June 3, 2026. I finally found time to work out the fix on November 16, 2026, and found that the bug's symptoms were reported as early as 2019 and addressed through workarounds rather than fixing the core problem. filesystem_common.go's Update() deduped mounts using the full filesystemLabels struct, which includes the raw mount options string. The labels actually exported as Prometheus metrics (filesystemLabelNames) don't include options. So a mount point that's bind-mounted and then remounted read-only — same device/mountpoint/fstype, different options — passed the dedup check as two separate mounts, got emitted twice, and collided downstream in the Prometheus client's own uniqueness check ("was collected before with the same name and label values"), spamming logs and burning CPU. History This exact symptom has been reported four times under four different trigger conditions, and every prior fix was a point exclusion rather than a fix to the actual mismatch: Agent does not work when /proc mount has hidepid=2 set #212 (2019) — /boot/efi duplicated under restrictive /proc hidepid settings. Closed stale, never fixed. do-agent process constant high CPU usage #233 (2020) — same /boot/efi duplicate on a stock droplet, no Kubernetes, no containers. "Fixed" in 3.8.0 by hardcoding /boot into the collector's exclusion list. Unable to gather advanced metrics, ERROR "was collected before with the same name and label values" #228 — same error under Kubernetes + kube-state-metrics pod mounts. --collector.filesystem.mount-points-exclude always fails with "mutually exclusive" error, even when used alone #367 (this repo) — CloudLinux CageFS per-account skeleton bind mounts on cPanel/WHM. This patch fixes the actual mismatch rather than adding another exclusion, so it should resolve all four without a workaround. Testing go build and go test ./... both pass cleanly. Reproduced the original bug live on a cPanel/CloudLinux host (8 caged accounts, ~75 CageFS skeleton bind mounts): 170k duplicate-metric log lines in 90s, 126% CPU with the stock binary and the filesystem collector enabled. Deployed this patched binary on the same host with the collector re-enabled: 72 distinct mount points exported, 0 duplicate-metric errors, CPU back to baseline (<0.2%), stable over several minutes of monitoring. Fixes #367 Fixes #228 Fixes #233 Fixes #212 Note for anyone testing this build: build with an explicit VERSION matching the current released version, e.g.: make build project=do-agent VERSION=<something-non-empty> The Makefile defaults VERSION to the current git tag, which is empty on a plain clone/fork without release tags — that bakes a blank version string into the binary (do-agent --version shows Version: with nothing after it). I saw this cause DigitalOcean's Insights dashboard to never switch from the hypervisor-only (hv_metrics) 3-panel view to the full 6-panel agent-reporting view, even though the agent was running cleanly with zero collection errors. Building with a real version string (I used 3.18.16-fix367 to match the base release plus this fix) resolved it immediately — the dashboard recognized the agent and switched views within the same monitoring cycle.
·
Insights
Load More
→