No data for sharded MongoDb collections

Hello!

We are experimenting with a 3 shard mongodb cluster, managed via psmdb-db operator.

We are also running pmm for monitoring, but we have a problem in which there is no data shown about sharded collections. For example “Cluster Summary” and “MongoDB Collection Details” don’t show any data at all.
I have tried adding “–enable-all-collectors”, but that does not work because of this other issue.
So, right now I am using the “–stats-collections” param to enable collectors for a specific collection. But this is also not taking any effect.

Everything is running on AKS v1.24.9.
Mongo version is 6.0.5-4.
PMM server is 2.36
PMM client is 2.36

What am I missing?

Thanks in advance!

Hi @adelmo ,

Did you pass --cluster parameter in mongodParams section of Operators?

When adding nodes of a sharded cluster, add each node separately using the --cluster mycluster option for the MongoDB Cluster Summary dashboard to populate correctly.

Here is the reference link.

Regards,
Parag

Hi @Parag_Bhayani ,
Thanks for your reply!

I wasn’t adding the --cluster parameter as it seems that the operator already does that for us.
However, reading your comment I have still added that parameter to the mongodParams section. It now looks like this:

mongodParams: '--cluster=mongodb01 --stats-collections=dev'

From pmm-client logs, I have the following command for the initialization of pmm-admin:

pmm-admin add mongodb --cluster=mongodb01 --stats-collections=dev --skip-connection-check --metrics-mode=push  --username=clusterMonitor --password=thePassword --cluster=mongodb01 --service-name=mongodb-mongodb01-shard1-0 --host=localhost --port=27017 --tls --tls-skip-verify --tls-certificate-key-file=/tmp/tls.pem --tls-ca-file=/etc/mongodb-ssl/ca.crt --authentication-mechanism=SCRAM-SHA-1 --authentication-database=admin;

Note that, now that I have added the parameter to mongodParams section, the --cluster=mongodb01 parameter is duplicate in the initialization command.

I still don’t have any data shown on the “MongoDB Collection Details” or “MongoDB Cluster Summary” dashboards.

Regards,
Adelmo