PMM-15363 Stop showing a real 0 as No Data - #5837
Conversation
The Nodes Overview table mapped 0 to "No Data" in fieldConfig.defaults,
so the rule applied to every field the panel's seven queries produce. An
idle node's Load Average of 0 rendered as "No Data", and so did a
Memory Available of 0% and a 100%-full disk's Min Space Available.
Grafana renders noValue without routing it through value mappings, so
the companion "-" rule never fired for a missing metric. Its only live
effect was on the node_name string column, where a node named "-"
rendered as "No Data" and corrupted the drill-down link built from
${__value.text}.
Remove mappings from defaults and relocate the 0 rule as a byName
override on the two columns where 0 is not a real reading: RAM and
Virtual Memory read container_spec_memory_limit_bytes, which cAdvisor
reports as 0 for a cgroup with no memory limit, and the `or` fallback to
node_memory_MemTotal_bytes only fires when the left side has no series.
Signed-off-by: theTibi <tkorocz@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5837 +/- ##
==========================================
- Coverage 43.59% 37.17% -6.42%
==========================================
Files 415 215 -200
Lines 43134 7182 -35952
Branches 0 587 +587
==========================================
- Hits 18804 2670 -16134
+ Misses 22454 4317 -18137
+ Partials 1876 195 -1681 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughThe MongoDB Cluster Summary and ReplSet Summary dashboards remove global dash and zero mappings. They add zero-value “No Data” mappings only to the RAM and Virtual Memory columns. Arrr. ChangesMongoDB dashboard mapping scope
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Full details: Description checkExplanation The description is complete and directly related to the change. It includes the ticket number, root cause, fix, scope, detailed validation, screenshots, and related work. The API documentation section is not included, but the PR does not alter API endpoints. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
ReplSet Summary, a node whose Load Average is a real, present
0renders as "No Data"instead of
0.00. The same defect hits Memory Available at0%.fieldConfig.defaults.mappingscarried two value-mapping rules,0 → "No Data"(colour#8b0000) and"-" → "No Data". Living indefaults, they applied toevery field the panel's seven queries produce — including the
node_namestring column.mappingsfromdefaults, and relocate0 → "No Data"as abyNameoverrideonto only the two columns where
0is not a real reading —RAMandVirtual Memory.Why the rule was relocated to two columns rather than five
The ticket suggested keeping
0 → "No Data"wherever zero means "not collected" — Uptime, RAM,Virtual Memory, Disk Space, Min Space Available. Verifying on a live server narrowed that to two:
RAM,Virtual Memorycontainer_spec_memory_limit_bytesis0for a cgroup with no memory limit, and theorfallback tonode_memory_MemTotal_bytesonly fires when the left side has no series — not when it is0. Rendering0.00 Bwould assert the node has no RAM.Load Average,Memory Available0on an idle node.Min Space Available0%, so the old rule actively hid disk exhaustion behind "No Data" — verified with a synthetic full filesystem: baseNo Data, patched0.00%.Uptime,Disk Space-, so the rule could only ever mislabel a real reading.Why
"-" → "No Data"was removed rather than keptIt never did what it looks like it does. Grafana renders
noValuewithout routing it throughvalue mappings, so a genuinely-absent metric shows
-and never reaches the map — verified on anode with no
node_load1series at all, before and after. Its only live effect was on thenode_namestring column: a node named-rendered as "No Data" and corrupted the drill-downlink built from
${__value.text}.Ticket
Screenshots
Panel 1309 rendered on a live PMM server (Grafana 12.4.5) via
/graph/d-soloagainst syntheticseries:
qa-zero-loadhasnode_load1 == 0,qa-zero-memhasMemAvailable == 0,qa-k8s-nolimithascontainer_spec_memory_limit_bytes == 0,qa-full-diskhas a 100 %-fullfilesystem,
qa-missing-loadhas nonode_load1series at all, one node is named literally-,and
qa-normalis the control.Before —
qa-zero-loadLoad Average andqa-zero-memMemory Available both read "No Data";the node named
-reads "No Data":After —
0.00and0.00%;qa-full-diskshows0.00%instead of hiding a full disk;-renders as itself;
qa-k8s-nolimitRAM / Virtual Memory still read "No Data" rather than a false0.00 B:Test plan
node_load1 == 0, Memory Available "No Data" forMemAvailable == 0.0.00and0.00%;0.53unchanged; every non-zero cell identical acrossseven nodes.
-placeholder, not a number.container_spec_memory_limit_bytes == 0(cgroup with no memory limit) still renders"No Data" on RAM and Virtual Memory — not
0.00 B.-renders as-and its drill-down link carriesvar-node_name=-.Min Space Available = 0.00%where base renders "No Data".MongoDB_Cluster_Summary.json1309 andMongoDB_ReplSet_Summary.json1675.python3 dashboards/misc/cleanup-dash.py --check-only <file>clean on both files.On the CI gate:
dashboards.ymlruns onlycleanup-dash.py --check-only, which compareseditable,time,timezone,refreshandid— it cannot seefieldConfigat all, anddashboards/pmm-app'syarn test:cireads no dashboard JSON. A green CI run proves nothing aboutthis class of defect; the live render above is the actual verification.
Follow-up (not in this PR)
dashboards/dashboards/Experimental/DB_Cluster_Summary.jsonpanels 1031 ("RAM") and 1032 ("Swap")have the same shape — a
0rule infieldConfig.defaultson a multi-column table — but map0to
"-", the same glyph asnoValue, making a present zero indistinguishable from missing data.Used(container_memory_swap) reads0in the normal no-swap-in-use case. Different dashboardand different symptom, so it wants its own ticket.
Related
git log -S '8b0000'over both files returns one commit — PMM-14837 Migrate grafana-dashboards to the monorepo #5150(PMM-14837, the grafana-dashboards monorepo migration). The block predates the monorepo in
percona/grafana-dashboards; PMM-15118: Fix Oplog GB/Hour PromQL missing service_name label #5594 touched only PromQL in these panels.but that PR was closed unmerged and pmm-qa
mainstill carriescodeceptjs-e2e/tests/pages/dashboardPage.js:1134-1138, which treats a panel as data-less if anydescendant text is exactly
No Dataor-. This PR removes the reported trigger; the panelcan still be counted when a cell legitimately renders
-(absent metric) orNo Data(RAM / Virtual Memory on a cgroup with no limit). Making that assertion robust is test-side work.