Skip to content

PMM-15363 Stop showing a real 0 as No Data - #5837

Merged
theTibi merged 3 commits into
mainfrom
PMM-15363-fix-zero-load-average-mapping
Sep 2, 2026
Merged

PMM-15363 Stop showing a real 0 as No Data#5837
theTibi merged 3 commits into
mainfrom
PMM-15363-fix-zero-load-average-mapping

Conversation

@theTibi

@theTibi theTibi commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Bug: on the Nodes Overview table of MongoDB Sharded Cluster Summary and MongoDB
    ReplSet Summary
    , a node whose Load Average is a real, present 0 renders as "No Data"
    instead of 0.00. The same defect hits Memory Available at 0%.
  • Root cause: the panel's fieldConfig.defaults.mappings carried two value-mapping rules,
    0 → "No Data" (colour #8b0000) and "-" → "No Data". Living in defaults, they applied to
    every field the panel's seven queries produce — including the node_name string column.
  • Fix: delete mappings from defaults, and relocate 0 → "No Data" as a byName override
    onto only the two columns where 0 is not a real reading — RAM and Virtual 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:

column keeps the rule? why
RAM, Virtual Memory yes container_spec_memory_limit_bytes is 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 — not when it is 0. Rendering 0.00 B would assert the node has no RAM.
Load Average, Memory Available no the reported bug — legitimately 0 on an idle node.
Min Space Available no a 100 %-full disk legitimately reads 0%, so the old rule actively hid disk exhaustion behind "No Data" — verified with a synthetic full filesystem: base No Data, patched 0.00%.
Uptime, Disk Space no a missing metric there already renders -, so the rule could only ever mislabel a real reading.

Why "-" → "No Data" was removed rather than kept

It never did what it looks like it does. Grafana renders noValue without routing it through
value mappings, so a genuinely-absent metric shows - and never reaches the map — verified on a
node with no node_load1 series at all, before and after. Its only live effect was on the
node_name string column: a node named - rendered as "No Data" and corrupted the drill-down
link built from ${__value.text}.

BASE:    Node Name cell text="No Data"  href=...&var-node_name=No%20Data
PATCHED: Node Name cell text="-"        href=...&var-node_name=-

Ticket

Screenshots

Panel 1309 rendered on a live PMM server (Grafana 12.4.5) via /graph/d-solo against synthetic
series: qa-zero-load has node_load1 == 0, qa-zero-mem has MemAvailable == 0,
qa-k8s-nolimit has container_spec_memory_limit_bytes == 0, qa-full-disk has a 100 %-full
filesystem, qa-missing-load has no node_load1 series at all, one node is named literally -,
and qa-normal is the control.

Beforeqa-zero-load Load Average and qa-zero-mem Memory Available both read "No Data";
the node named - reads "No Data":

NODE              RAM        Uptime       Disk Space  Load Average  Memory Available  Min Space Avail  Virtual Memory
qa-k8s-nolimit    No Data    60.00 mins   107.37 GB   0.42          100.00%           50.00%           No Data
No Data           8.59 GB    59.75 mins   107.37 GB   0.42          50.00%            50.00%           10.74 GB
qa-full-disk      8.59 GB    59.75 mins   107.37 GB   0.90          50.00%            No Data          10.74 GB
qa-missing-load   8.59 GB    59.75 mins   107.37 GB   -             50.00%            50.00%           10.74 GB
qa-normal         8.59 GB    59.75 mins   107.37 GB   0.53          50.00%            50.00%           10.74 GB
qa-zero-load      8.59 GB    59.75 mins   107.37 GB   No Data       50.00%            50.00%           10.74 GB
qa-zero-mem       8.59 GB    59.75 mins   107.37 GB   1.50          No Data           50.00%           10.74 GB

After0.00 and 0.00%; qa-full-disk shows 0.00% instead of hiding a full disk; -
renders as itself; qa-k8s-nolimit RAM / Virtual Memory still read "No Data" rather than a false
0.00 B:

NODE              RAM        Uptime       Disk Space  Load Average  Memory Available  Min Space Avail  Virtual Memory
qa-k8s-nolimit    No Data    1.00 hours   107.37 GB   0.42          100.00%           50.00%           No Data
-                 8.59 GB    1.00 hour    107.37 GB   0.42          50.00%            50.00%           10.74 GB
qa-full-disk      8.59 GB    1.00 hour    107.37 GB   0.90          50.00%            0.00%            10.74 GB
qa-missing-load   8.59 GB    1.00 hour    107.37 GB   -             50.00%            50.00%           10.74 GB
qa-normal         8.59 GB    1.00 hour    107.37 GB   0.53          50.00%            50.00%           10.74 GB
qa-zero-load      8.59 GB    1.00 hour    107.37 GB   0.00          50.00%            50.00%           10.74 GB
qa-zero-mem       8.59 GB    1.00 hour    107.37 GB   1.50          0.00%             50.00%           10.74 GB

Test plan

  • Reproduced live before the change on both panels: Load Average "No Data" for
    node_load1 == 0, Memory Available "No Data" for MemAvailable == 0.
  • Verified after: 0.00 and 0.00%; 0.53 unchanged; every non-zero cell identical across
    seven nodes.
  • Genuinely-absent metric still renders the - 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.
  • A node named - renders as - and its drill-down link carries var-node_name=-.
  • A 100 %-full filesystem renders Min Space Available = 0.00% where base renders "No Data".
  • Both panels verified separately — MongoDB_Cluster_Summary.json 1309 and
    MongoDB_ReplSet_Summary.json 1675.
  • python3 dashboards/misc/cleanup-dash.py --check-only <file> clean on both files.
  • pmm-submodules (FB) PR: PMM-15363 Feature build Percona-Lab/pmm-submodules#4546

On the CI gate: dashboards.yml runs only cleanup-dash.py --check-only, which compares
editable, time, timezone, refresh and id — it cannot see fieldConfig at all, and
dashboards/pmm-app's yarn test:ci reads no dashboard JSON. A green CI run proves nothing about
this class of defect; the live render above is the actual verification.

Follow-up (not in this PR)

dashboards/dashboards/Experimental/DB_Cluster_Summary.json panels 1031 ("RAM") and 1032 ("Swap")
have the same shape — a 0 rule in fieldConfig.defaults on a multi-column table — but map 0
to "-", the same glyph as noValue, making a present zero indistinguishable from missing data.
Used (container_memory_swap) reads 0 in the normal no-swap-in-use case. Different dashboard
and different symptom, so it wants its own ticket.

Related

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>
@theTibi
theTibi requested review from a team and Nailya as code owners August 26, 2026 10:10
@theTibi
theTibi requested review from fabio-silva and mattiasimonato and removed request for a team August 26, 2026 10:10
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.17%. Comparing base (31318c7) to head (d421cb2).
⚠️ Report is 163 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: de654b4b-3a4e-427c-bf8b-5ad9b259040d

📥 Commits

Reviewing files that changed from the base of the PR and between 6729e04 and bca5074.

📒 Files selected for processing (2)
  • dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json
  • dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • percona/pmm-qa (manual)
  • percona/pmm (manual)

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

The 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.

Changes

MongoDB dashboard mapping scope

Layer / File(s) Summary
Remove global mappings
dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json, dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json
The node summary tables no longer map dash and zero values to “No Data” globally.
Scope memory-field mappings
dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json, dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json
The Value #D and `Value `#E columns map zero values to “No Data”.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the main fix: real zero values no longer display as "No Data".
Description check ✅ Passed 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…
Full details: Description check

Explanation

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@it-percona-cla

it-percona-cla commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

CLA assistant check
All committers have signed the CLA.

@theTibi
theTibi merged commit 3f2fffe into main Sep 2, 2026
15 checks passed
@theTibi
theTibi deleted the PMM-15363-fix-zero-load-average-mapping branch September 2, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants