fix(dashboards): source Router Summary cluster variable from mongos metric (PMM-15174)#5608
Merged
Merged
Conversation
…etric (PMM-15174) The cluster template variable in the MongoDB Router Summary dashboard was populated from the mongod/replset metric mongodb_mongod_replset_my_state, while the dashboard's other cascading variables (service_name, node_name) and panel filters are all scoped to the mongos router metric mongodb_mongos_sharding_shards_total. The cluster label values on the mongod (shard) services do not necessarily match those on the mongos (router) services, so the Cluster dropdown showed wrong values or nothing and the router panels stayed empty. Source the cluster variable from mongodb_mongos_sharding_shards_total so it is consistent with service_name/node_name and lists exactly the clusters that have a mongos router. Signed-off-by: theTibi <tkorocz@gmail.com>
theTibi
requested review from
fabio-silva and
mattiasimonato
and removed request for
a team
July 7, 2026 09:52
1 task
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5608 +/- ##
==========================================
+ Coverage 43.59% 43.78% +0.19%
==========================================
Files 415 545 +130
Lines 43134 45087 +1953
Branches 0 591 +591
==========================================
+ Hits 18804 19742 +938
- Misses 22454 23407 +953
- Partials 1876 1938 +62
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fabio-silva
approved these changes
Jul 7, 2026
mattiasimonato
approved these changes
Jul 7, 2026
ademidoff
temporarily deployed
to
PMM-15174-fix-router-cluster-var - pmm-doc-3 PR #5608
July 7, 2026 14:13 — with
Render
Destroyed
theTibi
enabled auto-merge (squash)
July 13, 2026 08:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clustertemplate variable shows wrong values (or nothing), leaving the router panels empty.clustervariable was populated from the mongod/replset metricmongodb_mongod_replset_my_state, while the dashboard's other cascading variables (service_name,node_name) and panel filters are all scoped to the mongos router metricmongodb_mongos_sharding_shards_total. Theclusterlabel values on the mongod (shard) services do not necessarily match those on the mongos (router) services, so the dropdown was populated from the wrong metric.clustervariable frommongodb_mongos_sharding_shards_total(bothdefinitionandquery), matchingservice_name/node_nameand listing exactly the clusters that have a mongos router — as requested in the ticket.Ticket
Test plan
python3 dashboards/misc/cleanup-dash.py --check-only dashboards/dashboards/MongoDB/MongoDB_Router_Summary.jsonpasses (no formatting changes)Clusterdropdown lists the sharded cluster(s) with routers, and selecting one populatesservice_name/node_nameand renders data in the router panelsNotes
Routerspanel also queries the mongod metricmongodb_mongod_replset_my_state; this PR intentionally changes only theclustervariable per the ticket. A follow-up can address the panel if needed.