Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions support-bundle/README-edge.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,4 @@ For Enterprise and PCG clusters, the script collects MongoDB replica set informa
* `rs-conf.json`: Replica set configuration including member settings and priorities
* `replication-info.txt`: Oplog information and replication window
* `disk-usage.txt`: Actual `df -h /var/lib/mongodb` per mongo pod — the real on-disk size, which can differ from the requested PVC/PV size on thin-provisioned or fixed-disk-offering backends (e.g. CloudStack fixed offerings)
* `db-collection-sizes.txt`: Per-database and per-collection storage/data sizes (MB) and document counts — shows which collections are consuming disk
1 change: 1 addition & 0 deletions support-bundle/README-infra.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ For Enterprise and PCG clusters, the script collects MongoDB replica set informa
* `rs-conf.json`: Replica set configuration including member settings and priorities
* `replication-info.txt`: Oplog information and replication window
* `disk-usage.txt`: Actual `df -h /var/lib/mongodb` per mongo pod — the real on-disk size, which can differ from the requested PVC/PV size on thin-provisioned or fixed-disk-offering backends (e.g. CloudStack fixed offerings)
* `db-collection-sizes.txt`: Per-database and per-collection storage/data sizes (MB) and document counts — shows which collections are consuming disk

## Important Notes

Expand Down
11 changes: 11 additions & 0 deletions support-bundle/support-bundle-edge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,17 @@ function mongo-status() {
echo
} >> "${TMPDIR}/mongo/disk-usage.txt"
done < <(printf '%s\n' "$MONGO_PODS")

techo "Collecting MongoDB database + collection sizes"
kubectl exec -n hubble-system "$MONGO_POD" -c mongo -- bash -c "$MONGO_CMD $MONGO_AUTH admin --quiet --eval '
db.adminCommand({listDatabases:1}).databases.forEach(function(d){
var s = db.getSiblingDB(d.name).stats(1024*1024);
print(\"DB \"+d.name+\" storageSize(MB)=\"+s.storageSize+\" dataSize(MB)=\"+s.dataSize);
db.getSiblingDB(d.name).getCollectionNames().forEach(function(c){
var cs = db.getSiblingDB(d.name).getCollection(c).stats(1024*1024);
print(\" \"+d.name+\".\"+c+\" storageSize(MB)=\"+cs.storageSize+\" size(MB)=\"+cs.size+\" count=\"+cs.count);
});
});'" > "${TMPDIR}/mongo/db-collection-sizes.txt" 2>&1
}

function k8s-resources() {
Expand Down
11 changes: 11 additions & 0 deletions support-bundle/support-bundle-infra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,17 @@ function mongo-status() {
echo
} >> "${TMPDIR}/mongo/disk-usage.txt"
done < <(printf '%s\n' "$MONGO_PODS")

techo "Collecting MongoDB database + collection sizes"
kubectl exec -n hubble-system "$MONGO_POD" -c mongo -- bash -c "$MONGO_CMD $MONGO_AUTH admin --quiet --eval '
db.adminCommand({listDatabases:1}).databases.forEach(function(d){
var s = db.getSiblingDB(d.name).stats(1024*1024);
print(\"DB \"+d.name+\" storageSize(MB)=\"+s.storageSize+\" dataSize(MB)=\"+s.dataSize);
db.getSiblingDB(d.name).getCollectionNames().forEach(function(c){
var cs = db.getSiblingDB(d.name).getCollection(c).stats(1024*1024);
print(\" \"+d.name+\".\"+c+\" storageSize(MB)=\"+cs.storageSize+\" size(MB)=\"+cs.size+\" count=\"+cs.count);
});
});'" > "${TMPDIR}/mongo/db-collection-sizes.txt" 2>&1
}

function k8s-resources() {
Expand Down