PMM-15071: Add MongoDB Unused Indexes dashboard#5636
Conversation
Introduce a new Grafana dashboard under MongoDB dashboards that surfaces indexes with zero accesses since the last mongod restart using the mongodb_indexstats_accesses_ops metric. - Add MongoDB_Unused_Indexes.json with summary stats, unused index table, and index access activity panels - Register dashboard in pmm-app plugin.json - Add PMM UI navigation entry under MongoDB - Add dashboard reference documentation Co-authored-by: Fábio Silva <fabio-silva@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5636 +/- ##
==========================================
+ Coverage 43.59% 43.88% +0.28%
==========================================
Files 415 545 +130
Lines 43134 44426 +1292
Branches 0 591 +591
==========================================
+ Hits 18804 19495 +691
- Misses 22454 23099 +645
+ Partials 1876 1832 -44
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:
|
There was a problem hiding this comment.
Pull request overview
Adds a new Grafana dashboard to help identify MongoDB indexes with zero accesses since the last mongod restart, and wires it into PMM UI navigation, the dashboards plugin bundle, and the documentation site.
Changes:
- Introduces the MongoDB Unused Indexes dashboard (panels + variables + PromQL) based on
mongodb_indexstats_accesses_ops. - Registers the dashboard in the Grafana plugin bundle and adds a MongoDB navigation entry in PMM UI.
- Adds a new dashboard documentation page and links it in MkDocs navigation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/apps/pmm/src/contexts/navigation/navigation.constants.ts | Adds a MongoDB navigation item pointing to the new dashboard. |
| dashboards/dashboards/MongoDB/MongoDB_Unused_Indexes.json | New Grafana dashboard definition (panels, variables, queries). |
| dashboards/pmm-app/src/plugin.json | Registers the new dashboard so it’s shipped with the PMM Grafana plugin. |
| dashboards/README.md | Updates featured dashboards list to include the new dashboard. |
| documentation/docs/reference/dashboards/dashboard-mongodb-unused-indexes.md | Adds documentation for the new dashboard. |
| documentation/mkdocs-base.yml | Adds the new doc page to the MkDocs nav tree. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…//github.com/percona/pmm into cursor/mongodb-unused-indexes-dashboard-0faa
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Summary
Adds a new MongoDB Unused Indexes Grafana dashboard that surfaces indexes with zero accesses since the last
mongodrestart — candidates for review and possible removal.The dashboard uses the same core metric and logic as the existing MongoDB Unused Indexes advisor check:
Changes
dashboards/dashboards/MongoDB/MongoDB_Unused_Indexes.json_id_indexdashboards/pmm-app/src/plugin.jsondocumentation/docs/reference/dashboards/dashboard-mongodb-unused-indexes.mdRequirements
The
indexstatscollector must be enabled on the MongoDB exporter for this dashboard to show data.Notes
Screenshots
Ticket number: PMM-15071