From ffcfd8a293039198e187a681fa2e16a8f9e28959 Mon Sep 17 00:00:00 2001 From: Fabio Silva Date: Mon, 25 May 2026 17:36:02 +0100 Subject: [PATCH 1/8] feat: data size for clusters and rs --- .../MongoDB/MongoDB_Cluster_Summary.json | 244 +++++++++++++--- .../MongoDB/MongoDB_ReplSet_Summary.json | 269 ++++++++++++++---- .../dashboard-mongodb-cluster-summary.md | 8 + .../dashboard-mongodb-replset-summary.md | 7 + 4 files changed, 438 insertions(+), 90 deletions(-) diff --git a/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json b/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json index d06a013d35c..f6a2c5bd7a7 100644 --- a/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json +++ b/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json @@ -178,7 +178,7 @@ "h": 5, "w": 12, "x": 0, - "y": 41 + "y": 47 }, "id": 1306, "options": { @@ -332,7 +332,7 @@ "h": 5, "w": 12, "x": 12, - "y": 41 + "y": 47 }, "id": 1308, "options": { @@ -429,7 +429,7 @@ "type": "grafana-polystat-panel" }, { - "description": "A shard contains a subset of sharded data for a sharded cluster. Together, the cluster’s shards hold the entire data set for the cluster.", + "description": "A shard contains a subset of sharded data for a sharded cluster. Together, the cluster\u2019s shards hold the entire data set for the cluster.", "fieldConfig": { "defaults": { "mappings": [ @@ -539,7 +539,7 @@ "h": 5, "w": 11, "x": 7, - "y": 92 + "y": 98 }, "id": 1310, "options": { @@ -794,7 +794,7 @@ "type": "stat" }, { - "description": "A shard contains a subset of sharded data for a sharded cluster. Together, the cluster’s shards hold the entire data set for the cluster.", + "description": "A shard contains a subset of sharded data for a sharded cluster. Together, the cluster\u2019s shards hold the entire data set for the cluster.", "fieldConfig": { "defaults": { "color": { @@ -938,7 +938,7 @@ "type": "stat" }, { - "description": "When you run removeShard, MongoDB drains the shard by using the balancer to move the shard’s chunks to other shards in the cluster. Once the shard is drained, MongoDB removes the shard from the cluster.", + "description": "When you run removeShard, MongoDB drains the shard by using the balancer to move the shard\u2019s chunks to other shards in the cluster. Once the shard is drained, MongoDB removes the shard from the cluster.", "fieldConfig": { "defaults": { "color": { @@ -1312,6 +1312,172 @@ "title": "Last Election", "type": "stat" }, + { + "description": "Total logical data size (data + indexes) across all shard primaries in the cluster. Excludes admin, local, and config databases. Requires the dbstats collector.", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "rgb(31, 120, 193)", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 0, + "y": 10 + }, + "hideTimeOverride": true, + "id": 1703, + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": { + "valueSize": 28 + }, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.6.4", + "targets": [ + { + "editorMode": "code", + "expr": "sum(\n sum by (rs_nm) (\n sum(mongodb_dbstats_dataSize{environment=~\"$environment\", cluster=~\"$cluster\", cl_role=\"shardsvr\", rs_state=\"1\", database!~\"admin|local|config\"}) +\n sum(mongodb_dbstats_indexSize{environment=~\"$environment\", cluster=~\"$cluster\", cl_role=\"shardsvr\", rs_state=\"1\", database!~\"admin|local|config\"})\n )\n)", + "interval": "5m", + "intervalFactor": 1, + "legendFormat": "Total", + "range": false, + "refId": "A", + "step": 300 + } + ], + "title": "Total Data Size", + "type": "stat" + }, + { + "description": "Total logical data size across all shard primaries over time.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 18, + "x": 6, + "y": 10 + }, + "id": 1704, + "options": { + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.6.4", + "targets": [ + { + "editorMode": "code", + "expr": "sum(\n sum by (rs_nm) (\n sum(mongodb_dbstats_dataSize{environment=~\"$environment\", cluster=~\"$cluster\", cl_role=\"shardsvr\", rs_state=\"1\", database!~\"admin|local|config\"}) +\n sum(mongodb_dbstats_indexSize{environment=~\"$environment\", cluster=~\"$cluster\", cl_role=\"shardsvr\", rs_state=\"1\", database!~\"admin|local|config\"})\n )\n)", + "interval": "$interval", + "legendFormat": "Total Data Size", + "range": true, + "refId": "A" + } + ], + "title": "Data Size Over Time", + "type": "timeseries" + }, { "description": "Show the data distribution between all the shards involved (only user-created collections)", "fieldConfig": { @@ -1339,7 +1505,7 @@ "h": 7, "w": 24, "x": 0, - "y": 10 + "y": 16 }, "id": 1312, "options": { @@ -1453,7 +1619,7 @@ "h": 8, "w": 12, "x": 0, - "y": 17 + "y": 23 }, "id": 1269, "options": { @@ -1543,7 +1709,7 @@ "h": 8, "w": 12, "x": 12, - "y": 17 + "y": 23 }, "id": 1271, "options": { @@ -1649,7 +1815,7 @@ } ] }, - "unit": "µs" + "unit": "\u00b5s" }, "overrides": [] }, @@ -1657,7 +1823,7 @@ "h": 8, "w": 12, "x": 0, - "y": 25 + "y": 31 }, "id": 1297, "options": { @@ -1719,7 +1885,7 @@ "h": 8, "w": 12, "x": 12, - "y": 25 + "y": 31 }, "id": 1273, "options": { @@ -1838,7 +2004,7 @@ "h": 8, "w": 12, "x": 0, - "y": 33 + "y": 39 }, "id": 30, "options": { @@ -1938,7 +2104,7 @@ "h": 8, "w": 12, "x": 12, - "y": 33 + "y": 39 }, "hideTimeOverride": true, "id": 1289, @@ -2049,7 +2215,7 @@ "h": 1, "w": 24, "x": 0, - "y": 41 + "y": 47 }, "id": 1285, "panels": [ @@ -2162,7 +2328,7 @@ "h": 7, "w": 24, "x": 0, - "y": 42 + "y": 48 }, "id": 1281, "options": { @@ -2207,7 +2373,7 @@ "h": 1, "w": 24, "x": 0, - "y": 42 + "y": 48 }, "id": 81, "panels": [ @@ -2307,7 +2473,7 @@ "h": 7, "w": 24, "x": 0, - "y": 43 + "y": 49 }, "id": 37, "options": { @@ -2412,7 +2578,7 @@ "h": 7, "w": 24, "x": 0, - "y": 82 + "y": 88 }, "id": 1177, "options": { @@ -2459,7 +2625,7 @@ "h": 1, "w": 24, "x": 0, - "y": 43 + "y": 49 }, "id": 1279, "panels": [ @@ -2506,7 +2672,7 @@ "h": 8, "w": 24, "x": 0, - "y": 44 + "y": 50 }, "id": 1043, "options": { @@ -2627,7 +2793,7 @@ "h": 8, "w": 24, "x": 0, - "y": 52 + "y": 58 }, "id": 1030, "options": { @@ -2808,7 +2974,7 @@ "value": [ { "title": "", - "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}&${__url_time_range}&${interval:queryparam}&${cluster:queryparam}" + "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}\ufeff&\ufeff${__url_time_range}\ufeff&\ufeff${interval:queryparam}\ufeff&\ufeff${cluster:queryparam}" } ] } @@ -2820,7 +2986,7 @@ "h": 8, "w": 24, "x": 0, - "y": 60 + "y": 66 }, "id": 1327, "options": { @@ -2980,7 +3146,7 @@ "h": 8, "w": 24, "x": 0, - "y": 68 + "y": 74 }, "id": 1305, "options": { @@ -3105,7 +3271,7 @@ "h": 1, "w": 24, "x": 0, - "y": 76 + "y": 82 }, "id": 1199, "panels": [ @@ -3136,7 +3302,7 @@ "h": 7, "w": 24, "x": 0, - "y": 112 + "y": 118 }, "id": 1313, "options": { @@ -3232,7 +3398,7 @@ "h": 8, "w": 6, "x": 0, - "y": 119 + "y": 125 }, "id": 1200, "options": { @@ -3350,7 +3516,7 @@ "h": 8, "w": 18, "x": 6, - "y": 119 + "y": 125 }, "id": 1201, "options": { @@ -3447,7 +3613,7 @@ "h": 7, "w": 24, "x": 0, - "y": 127 + "y": 133 }, "id": 1216, "options": { @@ -3544,7 +3710,7 @@ "h": 7, "w": 24, "x": 0, - "y": 134 + "y": 140 }, "id": 1212, "options": { @@ -3587,7 +3753,7 @@ "h": 1, "w": 24, "x": 0, - "y": 77 + "y": 83 }, "id": 97, "panels": [ @@ -3659,7 +3825,7 @@ "h": 8, "w": 8, "x": 0, - "y": 113 + "y": 119 }, "id": 14, "options": { @@ -3764,7 +3930,7 @@ "h": 8, "w": 8, "x": 8, - "y": 113 + "y": 119 }, "id": 27, "options": { @@ -3858,7 +4024,7 @@ } ] }, - "unit": "µs" + "unit": "\u00b5s" }, "overrides": [ { @@ -3883,7 +4049,7 @@ "h": 8, "w": 8, "x": 16, - "y": 113 + "y": 119 }, "id": 1324, "options": { @@ -3994,7 +4160,7 @@ "h": 7, "w": 24, "x": 0, - "y": 121 + "y": 127 }, "id": 1299, "maxPerRow": 3, @@ -4045,7 +4211,7 @@ "h": 1, "w": 24, "x": 0, - "y": 78 + "y": 84 }, "id": 1326, "panels": [ @@ -4240,7 +4406,7 @@ "h": 7, "w": 24, "x": 0, - "y": 114 + "y": 120 }, "id": 1309, "options": { diff --git a/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json b/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json index 80c9f73322c..a2e3bb3f3ab 100644 --- a/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json +++ b/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json @@ -580,13 +580,179 @@ "title": "Last Election", "type": "stat" }, + { + "description": "Total logical data size (data + indexes) across user databases on the replica set primary. Excludes admin, local, and config databases. Requires the dbstats collector (enable all collectors on the MongoDB exporter).", + "fieldConfig": { + "defaults": { + "color": { + "fixedColor": "rgb(31, 120, 193)", + "mode": "fixed" + }, + "decimals": 2, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 6, + "x": 0, + "y": 5 + }, + "hideTimeOverride": true, + "id": 1701, + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "text": { + "valueSize": 28 + }, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.6.4", + "targets": [ + { + "editorMode": "code", + "expr": "sum(mongodb_dbstats_dataSize{environment=~\"$environment\", cluster=~\"$cluster\", rs_nm=~\"$rs_nm\", rs_state=\"1\", database!~\"admin|local|config\"}) + sum(mongodb_dbstats_indexSize{environment=~\"$environment\", cluster=~\"$cluster\", rs_nm=~\"$rs_nm\", rs_state=\"1\", database!~\"admin|local|config\"})", + "interval": "5m", + "intervalFactor": 1, + "legendFormat": "Total", + "range": false, + "refId": "A", + "step": 300 + } + ], + "title": "Total Data Size", + "type": "stat" + }, + { + "description": "Total logical data size (data + indexes) over time on the replica set primary.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 18, + "x": 6, + "y": 5 + }, + "id": 1702, + "options": { + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "11.6.4", + "targets": [ + { + "editorMode": "code", + "expr": "sum(mongodb_dbstats_dataSize{environment=~\"$environment\", cluster=~\"$cluster\", rs_nm=~\"$rs_nm\", rs_state=\"1\", database!~\"admin|local|config\"}) + sum(mongodb_dbstats_indexSize{environment=~\"$environment\", cluster=~\"$cluster\", rs_nm=~\"$rs_nm\", rs_state=\"1\", database!~\"admin|local|config\"})", + "interval": "$interval", + "legendFormat": "Total Data Size", + "range": true, + "refId": "A" + } + ], + "title": "Data Size Over Time", + "type": "timeseries" + }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 5 + "y": 11 }, "id": 1030, "panels": [], @@ -672,7 +838,7 @@ "h": 4, "w": 2, "x": 0, - "y": 6 + "y": 12 }, "id": 1586, "options": { @@ -880,7 +1046,7 @@ "h": 4, "w": 3, "x": 2, - "y": 6 + "y": 12 }, "id": 1071, "options": { @@ -950,7 +1116,7 @@ "h": 4, "w": 3, "x": 5, - "y": 6 + "y": 12 }, "id": 1060, "options": { @@ -1012,7 +1178,7 @@ "h": 4, "w": 3, "x": 8, - "y": 6 + "y": 12 }, "id": 1073, "options": { @@ -1080,7 +1246,7 @@ "h": 4, "w": 3, "x": 11, - "y": 6 + "y": 12 }, "id": 1062, "options": { @@ -1147,7 +1313,7 @@ "h": 4, "w": 3, "x": 14, - "y": 6 + "y": 12 }, "id": 1076, "options": { @@ -1239,7 +1405,7 @@ "h": 4, "w": 3, "x": 17, - "y": 6 + "y": 12 }, "id": 1052, "options": { @@ -1298,7 +1464,7 @@ "type": "stat" }, { - "description": "The parameter shows how long a system has been “up” and running without a shut down or restart.", + "description": "The parameter shows how long a system has been \u201cup\u201d and running without a shut down or restart.", "fieldConfig": { "defaults": { "color": { @@ -1330,7 +1496,7 @@ "h": 4, "w": 2, "x": 20, - "y": 6 + "y": 12 }, "id": 321, "interval": "$interval", @@ -1400,7 +1566,7 @@ "h": 4, "w": 2, "x": 22, - "y": 6 + "y": 12 }, "id": 1039, "interval": "$interval", @@ -1455,7 +1621,7 @@ "h": 1, "w": 24, "x": 0, - "y": 20 + "y": 26 }, "id": 1170, "panels": [], @@ -1539,7 +1705,7 @@ "h": 8, "w": 12, "x": 0, - "y": 21 + "y": 27 }, "id": 15, "options": { @@ -1630,7 +1796,7 @@ "h": 8, "w": 12, "x": 12, - "y": 21 + "y": 27 }, "id": 1024, "options": { @@ -1731,7 +1897,7 @@ } ] }, - "unit": "µs" + "unit": "\u00b5s" }, "overrides": [] }, @@ -1739,7 +1905,7 @@ "h": 8, "w": 12, "x": 0, - "y": 29 + "y": 35 }, "id": 1064, "options": { @@ -1801,7 +1967,7 @@ "h": 8, "w": 12, "x": 12, - "y": 29 + "y": 35 }, "id": 1028, "options": { @@ -1908,7 +2074,7 @@ "h": 8, "w": 12, "x": 0, - "y": 37 + "y": 43 }, "id": 1066, "options": { @@ -2024,7 +2190,7 @@ "h": 8, "w": 12, "x": 12, - "y": 37 + "y": 43 }, "id": 1036, "options": { @@ -2127,7 +2293,7 @@ "h": 8, "w": 12, "x": 0, - "y": 45 + "y": 51 }, "id": 1067, "options": { @@ -2258,7 +2424,7 @@ "h": 8, "w": 12, "x": 12, - "y": 45 + "y": 51 }, "id": 1074, "options": { @@ -2328,7 +2494,7 @@ "h": 1, "w": 24, "x": 0, - "y": 53 + "y": 59 }, "id": 1056, "panels": [], @@ -2399,7 +2565,7 @@ "value": [ { "title": "", - "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}&${__url_time_range}&${interval:queryparam}&${cluster:queryparam}" + "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}\ufeff&\ufeff${__url_time_range}\ufeff&\ufeff${interval:queryparam}\ufeff&\ufeff${cluster:queryparam}\ufeff" } ] } @@ -2411,7 +2577,7 @@ "h": 8, "w": 24, "x": 0, - "y": 54 + "y": 60 }, "id": 1045, "options": { @@ -2548,7 +2714,7 @@ "value": [ { "title": "", - "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}&${__url_time_range}&${interval:queryparam}&${cluster:queryparam}" + "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}\ufeff&\ufeff${__url_time_range}\ufeff&\ufeff${interval:queryparam}\ufeff&\ufeff${cluster:queryparam}" } ] } @@ -2560,7 +2726,7 @@ "h": 8, "w": 24, "x": 0, - "y": 62 + "y": 68 }, "id": 1043, "options": { @@ -2710,7 +2876,7 @@ "value": [ { "title": "", - "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}&${__url_time_range}&${interval:queryparam}&${cluster:queryparam}" + "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}\ufeff&\ufeff${__url_time_range}\ufeff&\ufeff${interval:queryparam}\ufeff&\ufeff${cluster:queryparam}" } ] } @@ -2722,7 +2888,7 @@ "h": 8, "w": 24, "x": 0, - "y": 70 + "y": 76 }, "id": 1681, "options": { @@ -2886,7 +3052,7 @@ "value": [ { "title": "", - "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}&${__url_time_range}&${interval:queryparam}&${cluster:queryparam}" + "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}\ufeff&\ufeff${__url_time_range}\ufeff&\ufeff${interval:queryparam}\ufeff&\ufeff${cluster:queryparam}" } ] } @@ -2898,7 +3064,7 @@ "h": 8, "w": 24, "x": 0, - "y": 78 + "y": 84 }, "id": 1672, "options": { @@ -2985,7 +3151,7 @@ "h": 1, "w": 24, "x": 0, - "y": 86 + "y": 92 }, "id": 1049, "panels": [ @@ -3086,7 +3252,7 @@ "h": 7, "w": 8, "x": 0, - "y": 136 + "y": 142 }, "id": 1038, "options": { @@ -3221,7 +3387,7 @@ "h": 7, "w": 8, "x": 8, - "y": 136 + "y": 142 }, "id": 1025, "options": { @@ -3313,7 +3479,7 @@ } ] }, - "unit": "µs" + "unit": "\u00b5s" }, "overrides": [ { @@ -3338,7 +3504,7 @@ "h": 7, "w": 8, "x": 16, - "y": 136 + "y": 142 }, "id": 1020, "options": { @@ -3449,7 +3615,7 @@ "h": 8, "w": 24, "x": 0, - "y": 143 + "y": 149 }, "id": 1680, "options": { @@ -3499,7 +3665,7 @@ "h": 1, "w": 24, "x": 0, - "y": 87 + "y": 93 }, "id": 1150, "panels": [ @@ -3616,7 +3782,7 @@ "h": 6, "w": 24, "x": 0, - "y": 164 + "y": 170 }, "id": 1587, "options": { @@ -3659,7 +3825,7 @@ "h": 1, "w": 24, "x": 0, - "y": 88 + "y": 94 }, "id": 1403, "panels": [ @@ -3854,7 +4020,7 @@ "h": 7, "w": 24, "x": 0, - "y": 165 + "y": 171 }, "id": 1675, "options": { @@ -4012,7 +4178,7 @@ "h": 1, "w": 24, "x": 0, - "y": 89 + "y": 95 }, "id": 1569, "panels": [ @@ -4270,7 +4436,7 @@ "h": 8, "w": 24, "x": 0, - "y": 166 + "y": 172 }, "id": 1676, "options": { @@ -4347,7 +4513,7 @@ "h": 1, "w": 24, "x": 0, - "y": 90 + "y": 96 }, "id": 1571, "panels": [ @@ -4558,7 +4724,7 @@ "h": 8, "w": 24, "x": 0, - "y": 200 + "y": 206 }, "id": 1677, "options": { @@ -4629,7 +4795,7 @@ "h": 1, "w": 24, "x": 0, - "y": 91 + "y": 97 }, "id": 1585, "panels": [ @@ -4779,7 +4945,7 @@ "h": 8, "w": 24, "x": 0, - "y": 211 + "y": 217 }, "id": 1678, "links": [ @@ -4883,7 +5049,7 @@ "h": 1, "w": 24, "x": 0, - "y": 92 + "y": 98 }, "id": 1583, "panels": [ @@ -4964,7 +5130,7 @@ "h": 8, "w": 24, "x": 0, - "y": 169 + "y": 175 }, "id": 1679, "options": { @@ -5131,11 +5297,12 @@ }, { "current": { - "text": "", - "value": "" + "text": "All", + "value": "$__all" }, + "allValue": ".*", "definition": "label_values(mongodb_mongod_replset_my_state{environment=~\"$environment\",cluster=~\"$cluster\"}, set)", - "includeAll": false, + "includeAll": true, "label": "Replica Set", "name": "rs_nm", "options": [], diff --git a/documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md b/documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md index f094cd5544c..2ce38258e0b 100644 --- a/documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md +++ b/documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md @@ -79,6 +79,14 @@ Elections occur when a new primary node needs to be chosen, which can happen dur A very recent election might indicate a recent change or issue in your cluster that warrants investigation, while a long time since the last election suggests stability in the primary node assignment. +### Total Data Size + +Shows the total logical data size (uncompressed data plus indexes) summed across all shard primaries in the cluster. System databases (`admin`, `local`, and `config`) are excluded. Config server metadata is not included in this total. + +Use this metric to monitor overall data growth for the sharded cluster, similar to the cluster data size view in Ops Manager. The **Data Size Over Time** graph shows the same total over the selected time range. + +This panel requires the MongoDB exporter **dbstats** collector on shard `mongod` nodes. Enable it by turning on **Enable all collectors** for the MongoDB service in PMM (or ensure `dbstats` is not listed under disabled collectors). + ### Chunks distribution Displays the distribution of chunks across different shards in a MongoDB cluster as a series of horizontal bars. It updates every minute, showing the percentage of total chunks each shard holds. diff --git a/documentation/docs/reference/dashboards/dashboard-mongodb-replset-summary.md b/documentation/docs/reference/dashboards/dashboard-mongodb-replset-summary.md index ca1b11cc58e..75b38619a8a 100644 --- a/documentation/docs/reference/dashboards/dashboard-mongodb-replset-summary.md +++ b/documentation/docs/reference/dashboards/dashboard-mongodb-replset-summary.md @@ -27,6 +27,13 @@ Frequent elections can indicate connectivity issues or node failures. A stable r If the value is low, it may indicate a problem that needs investigation. +### Total Data Size +Shows the total logical data size (uncompressed data plus indexes) across all user databases on the replica set primary. System databases (`admin`, `local`, and `config`) are excluded. + +Use this metric to monitor data growth for the replica set, similar to the cluster data size view in Ops Manager. The **Data Size Over Time** graph shows the same total over the selected time range. + +This panel requires the MongoDB exporter **dbstats** collector. Enable it by turning on **Enable all collectors** for the MongoDB service in PMM (or ensure `dbstats` is not listed under disabled collectors). + ### State Shows the current replica set state of this MongoDB node. MongoDB replica set members can be in various states including PRIMARY (handling all write operations), SECONDARY (replicating data from the primary), ARBITER (participating in elections but not storing data), or several transitional states. From a49b630fc1df76b384d596e86a6fbdac77428890 Mon Sep 17 00:00:00 2001 From: Fabio Silva Date: Mon, 25 May 2026 17:47:31 +0100 Subject: [PATCH 2/8] fix: expressions --- .../MongoDB/MongoDB_Cluster_Summary.json | 6 +++--- .../MongoDB/MongoDB_ReplSet_Summary.json | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json b/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json index f6a2c5bd7a7..1917883a1e1 100644 --- a/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json +++ b/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json @@ -1371,7 +1371,7 @@ "targets": [ { "editorMode": "code", - "expr": "sum(\n sum by (rs_nm) (\n sum(mongodb_dbstats_dataSize{environment=~\"$environment\", cluster=~\"$cluster\", cl_role=\"shardsvr\", rs_state=\"1\", database!~\"admin|local|config\"}) +\n sum(mongodb_dbstats_indexSize{environment=~\"$environment\", cluster=~\"$cluster\", cl_role=\"shardsvr\", rs_state=\"1\", database!~\"admin|local|config\"})\n )\n)", + "expr": "sum(mongodb_dbstats_dataSize{environment=~\"$environment\", cluster=~\"$cluster\", cl_role=\"shardsvr\", rs_state=\"1\", database!~\"^(admin|local|config)$\"}) + sum(mongodb_dbstats_indexSize{environment=~\"$environment\", cluster=~\"$cluster\", cl_role=\"shardsvr\", rs_state=\"1\", database!~\"^(admin|local|config)$\"})", "interval": "5m", "intervalFactor": 1, "legendFormat": "Total", @@ -1468,7 +1468,7 @@ "targets": [ { "editorMode": "code", - "expr": "sum(\n sum by (rs_nm) (\n sum(mongodb_dbstats_dataSize{environment=~\"$environment\", cluster=~\"$cluster\", cl_role=\"shardsvr\", rs_state=\"1\", database!~\"admin|local|config\"}) +\n sum(mongodb_dbstats_indexSize{environment=~\"$environment\", cluster=~\"$cluster\", cl_role=\"shardsvr\", rs_state=\"1\", database!~\"admin|local|config\"})\n )\n)", + "expr": "sum(mongodb_dbstats_dataSize{environment=~\"$environment\", cluster=~\"$cluster\", cl_role=\"shardsvr\", rs_state=\"1\", database!~\"^(admin|local|config)$\"}) + sum(mongodb_dbstats_indexSize{environment=~\"$environment\", cluster=~\"$cluster\", cl_role=\"shardsvr\", rs_state=\"1\", database!~\"^(admin|local|config)$\"})", "interval": "$interval", "legendFormat": "Total Data Size", "range": true, @@ -2974,7 +2974,7 @@ "value": [ { "title": "", - "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}\ufeff&\ufeff${__url_time_range}\ufeff&\ufeff${interval:queryparam}\ufeff&\ufeff${cluster:queryparam}" + "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}&${__url_time_range}&${interval:queryparam}&${cluster:queryparam}" } ] } diff --git a/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json b/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json index a2e3bb3f3ab..ef42b6b1818 100644 --- a/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json +++ b/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json @@ -639,7 +639,7 @@ "targets": [ { "editorMode": "code", - "expr": "sum(mongodb_dbstats_dataSize{environment=~\"$environment\", cluster=~\"$cluster\", rs_nm=~\"$rs_nm\", rs_state=\"1\", database!~\"admin|local|config\"}) + sum(mongodb_dbstats_indexSize{environment=~\"$environment\", cluster=~\"$cluster\", rs_nm=~\"$rs_nm\", rs_state=\"1\", database!~\"admin|local|config\"})", + "expr": "sum(mongodb_dbstats_dataSize{environment=~\"$environment\", cluster=~\"$cluster\", rs_nm=~\"$rs_nm\", rs_state=\"1\", database!~\"^(admin|local|config)$\"}) + sum(mongodb_dbstats_indexSize{environment=~\"$environment\", cluster=~\"$cluster\", rs_nm=~\"$rs_nm\", rs_state=\"1\", database!~\"^(admin|local|config)$\"})", "interval": "5m", "intervalFactor": 1, "legendFormat": "Total", @@ -736,7 +736,7 @@ "targets": [ { "editorMode": "code", - "expr": "sum(mongodb_dbstats_dataSize{environment=~\"$environment\", cluster=~\"$cluster\", rs_nm=~\"$rs_nm\", rs_state=\"1\", database!~\"admin|local|config\"}) + sum(mongodb_dbstats_indexSize{environment=~\"$environment\", cluster=~\"$cluster\", rs_nm=~\"$rs_nm\", rs_state=\"1\", database!~\"admin|local|config\"})", + "expr": "sum(mongodb_dbstats_dataSize{environment=~\"$environment\", cluster=~\"$cluster\", rs_nm=~\"$rs_nm\", rs_state=\"1\", database!~\"^(admin|local|config)$\"}) + sum(mongodb_dbstats_indexSize{environment=~\"$environment\", cluster=~\"$cluster\", rs_nm=~\"$rs_nm\", rs_state=\"1\", database!~\"^(admin|local|config)$\"})", "interval": "$interval", "legendFormat": "Total Data Size", "range": true, @@ -2565,7 +2565,7 @@ "value": [ { "title": "", - "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}\ufeff&\ufeff${__url_time_range}\ufeff&\ufeff${interval:queryparam}\ufeff&\ufeff${cluster:queryparam}\ufeff" + "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}&${__url_time_range}&${interval:queryparam}&${cluster:queryparam}" } ] } @@ -2714,7 +2714,7 @@ "value": [ { "title": "", - "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}\ufeff&\ufeff${__url_time_range}\ufeff&\ufeff${interval:queryparam}\ufeff&\ufeff${cluster:queryparam}" + "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}&${__url_time_range}&${interval:queryparam}&${cluster:queryparam}" } ] } @@ -2876,7 +2876,7 @@ "value": [ { "title": "", - "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}\ufeff&\ufeff${__url_time_range}\ufeff&\ufeff${interval:queryparam}\ufeff&\ufeff${cluster:queryparam}" + "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}&${__url_time_range}&${interval:queryparam}&${cluster:queryparam}" } ] } @@ -3052,7 +3052,7 @@ "value": [ { "title": "", - "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}\ufeff&\ufeff${__url_time_range}\ufeff&\ufeff${interval:queryparam}\ufeff&\ufeff${cluster:queryparam}" + "url": "/graph/d/mongodb-instance-summary/mongodb-instance-summary?${__data.fields.Node}&${__url_time_range}&${interval:queryparam}&${cluster:queryparam}" } ] } @@ -3278,7 +3278,7 @@ "targets": [ { "editorMode": "code", - "expr": "max_over_time(mongodb_mongod_replset_member_replication_lag{environment=~\"$environment\",cluster=~\"$cluster\",set=\"$rs_nm\",self=~\"|1\",service_name=~\"$secondary\"}[$interval]) > 0 ", + "expr": "max_over_time(mongodb_mongod_replset_member_replication_lag{environment=~\"$environment\",cluster=~\"$cluster\",set=~\"$rs_nm\",self=~\"|1\",service_name=~\"$secondary\"}[$interval]) > 0 ", "interval": "$interval", "intervalFactor": 1, "legendFormat": "{{service_name}}", From 2d850c3aac1cf3a492ca8e738b3ed0b9fd54c658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Silva?= Date: Tue, 16 Jun 2026 10:28:04 +0100 Subject: [PATCH 3/8] Update dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json Co-authored-by: Catalina A <94133018+catalinaadam@users.noreply.github.com> --- dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json b/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json index 1917883a1e1..05830600123 100644 --- a/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json +++ b/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json @@ -1313,7 +1313,7 @@ "type": "stat" }, { - "description": "Total logical data size (data + indexes) across all shard primaries in the cluster. Excludes admin, local, and config databases. Requires the dbstats collector.", + "description": "Shows how much space your data and indexes currently occupy across all shard primaries in the cluster, excluding system databases (admin, local, config) and config server metadata. Requires the dbstats collector on the MongoDB exporter. To enable it, see [Add database services](https://per.co.na/pmm/pmm-admin-add).", "fieldConfig": { "defaults": { "color": { From 9207f2a269eef1007c6c44367707cf406d43eb93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Silva?= Date: Tue, 16 Jun 2026 10:28:27 +0100 Subject: [PATCH 4/8] Update dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json Co-authored-by: Catalina A <94133018+catalinaadam@users.noreply.github.com> --- dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json b/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json index 05830600123..eb3c5e5b500 100644 --- a/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json +++ b/dashboards/dashboards/MongoDB/MongoDB_Cluster_Summary.json @@ -1384,7 +1384,7 @@ "type": "stat" }, { - "description": "Total logical data size across all shard primaries over time.", + "description": "Plots the total size of data and indexes across all shard primaries over the selected time range. Use this to spot growth trends and plan capacity.", "fieldConfig": { "defaults": { "color": { From 5197e03a2c2b478ed2705e6cb3401c768ff60c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Silva?= Date: Tue, 16 Jun 2026 10:28:51 +0100 Subject: [PATCH 5/8] Update dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json Co-authored-by: Catalina A <94133018+catalinaadam@users.noreply.github.com> --- dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json b/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json index ef42b6b1818..6e9261654e3 100644 --- a/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json +++ b/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json @@ -581,7 +581,7 @@ "type": "stat" }, { - "description": "Total logical data size (data + indexes) across user databases on the replica set primary. Excludes admin, local, and config databases. Requires the dbstats collector (enable all collectors on the MongoDB exporter).", + "description": "Shows how much space your data and indexes currently occupy on the replica set primary, excluding system databases (admin, local, config). Requires the dbstats collector on the MongoDB exporter. To enable it, see [Add database services](https://per.co.na/pmm/pmm-admin-add).", "fieldConfig": { "defaults": { "color": { From a8b5f97bc4922402476503c33ad8724d190721c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Silva?= Date: Tue, 16 Jun 2026 10:29:09 +0100 Subject: [PATCH 6/8] Update dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json Co-authored-by: Catalina A <94133018+catalinaadam@users.noreply.github.com> --- dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json b/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json index 6e9261654e3..5d27a07adbd 100644 --- a/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json +++ b/dashboards/dashboards/MongoDB/MongoDB_ReplSet_Summary.json @@ -652,7 +652,7 @@ "type": "stat" }, { - "description": "Total logical data size (data + indexes) over time on the replica set primary.", + "description": "Plots the total size of data and indexes on the replica set primary over the selected time range. Use this to spot growth trends and plan capacity.", "fieldConfig": { "defaults": { "color": { From 465649a5be4afa4e63c91ff10aaa319bdac1ec66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Silva?= Date: Tue, 16 Jun 2026 10:34:39 +0100 Subject: [PATCH 7/8] Update documentation/docs/reference/dashboards/dashboard-mongodb-replset-summary.md Co-authored-by: Catalina A <94133018+catalinaadam@users.noreply.github.com> --- .../dashboard-mongodb-replset-summary.md | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/documentation/docs/reference/dashboards/dashboard-mongodb-replset-summary.md b/documentation/docs/reference/dashboards/dashboard-mongodb-replset-summary.md index a90d1b69ff1..8aeb035b837 100644 --- a/documentation/docs/reference/dashboards/dashboard-mongodb-replset-summary.md +++ b/documentation/docs/reference/dashboards/dashboard-mongodb-replset-summary.md @@ -40,7 +40,25 @@ Shows the time elapsed since the most recent primary election. A recent election is worth investigating to find out whether it was a planned failover or an unexpected event. Frequent elections indicate connectivity issues or node instability. -### Total Data Size +### Total data size + +Shows how much storage your replica set is currently using for data and indexes on the primary node. System databases (`admin`, `local`, `config`) are excluded. + +Check this panel regularly to understand your current storage footprint. If the value is growing faster than expected, check **Size of Collections** and **Number of Collections** panels in the **Collection Details** section to identify what is driving the growth. + +Use the trend in the **Data size over time** panel to decide when to add storage capacity. + +This panel requires the `dbstats` collector on the MongoDB exporter. To enable it, see [Add database services](https://per.co.na/pmm/pmm-admin-add). + +### Data size over time + +Shows how your replica set's total data and index size changes over the selected time +range. + +Use this to spot growth trends, identify unexpected spikes, and plan when you +will need to add storage capacity. + +A sudden increase may indicate a bulk data load, a missing TTL index, or runaway data growth that needs investigation. Shows the total logical data size (uncompressed data plus indexes) across all user databases on the replica set primary. System databases (`admin`, `local`, and `config`) are excluded. Use this metric to monitor data growth for the replica set, similar to the cluster data size view in Ops Manager. The **Data Size Over Time** graph shows the same total over the selected time range. From 187b5f9d9acdc64e8dc16b801eaa3bec0d8ee6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Silva?= Date: Tue, 16 Jun 2026 10:35:47 +0100 Subject: [PATCH 8/8] Update documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md Co-authored-by: Catalina A <94133018+catalinaadam@users.noreply.github.com> --- .../dashboard-mongodb-cluster-summary.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md b/documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md index bc86e9297ce..b6d83688970 100644 --- a/documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md +++ b/documentation/docs/reference/dashboards/dashboard-mongodb-cluster-summary.md @@ -73,7 +73,19 @@ Shows the number of user-created databases in the cluster. Watch this over time Shows whether the cluster balancer is currently enabled. YES means the balancer is active and will redistribute chunks when shards become unbalanced. NO means balancing is paused, which may cause chunk distribution to drift over time. Investigate if the balancer is unexpectedly disabled. -### Total Data Size +### Total data size + +Shows how much storage your sharded cluster is currently using for data and indexes +across all shard primaries. System databases (`admin`, `local`, `config`) and config server metadata are excluded. + +Check this panel regularly to understand your cluster's total storage footprint. Compare it with the **Data distribution** panel to see whether data is growing evenly across shards or concentrating on specific ones. Use the trend in **Data size over time** to decide when to add shards or storage capacity. + +This panel requires the `dbstats` collector on the MongoDB exporter on each shard `mongod` node. To enable it, see [Add database services](https://per.co.na/pmm/pmm-admin-add). + +### Data size over time + +Shows how your cluster's total data and index size changes over the selected time range. +Use this to spot growth trends, identify unexpected spikes, and plan when you will need to scale storage or add shards. A sudden increase may indicate a bulk data load, a missing TTL index, or uneven shard growth that needs investigation. Shows the total logical data size (uncompressed data plus indexes) summed across all shard primaries in the cluster. System databases (`admin`, `local`, and `config`) are excluded. Config server metadata is not included in this total.