# Number of collections not visible in mongodb

**URL:** <https://forums.percona.com/t/number-of-collections-not-visible-in-mongodb/36041>\
**Category:** PMM 2.x\
**Created:** [January 9, 2025, 9:54am UTC](https://forums.percona.com/t/number-of-collections-not-visible-in-mongodb/36041 "2025-01-09T09:54:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pramod\_Kumar\_Gupta](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/pramod_kumar_gupta/32/19488_2.png) [@Pramod\_Kumar\_Gupta](https://forums.percona.com/u/Pramod_Kumar_Gupta)\
**Post date:** [January 9, 2025, 9:54am UTC](https://forums.percona.com/t/number-of-collections-not-visible-in-mongodb/36041/1 "2025-01-09T09:54:38Z")

</div>

getting this error in logs of pmm-client

level=error msg="cannot get $collstats cursor for collection db1 : context deadline exceeded

---

<div class="post-metadata">

**Author:** ![nurlan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/nurlan/32/1523_2.png) [@nurlan](https://forums.percona.com/u/nurlan)\
**Post date:** [January 9, 2025, 10:42am UTC](https://forums.percona.com/t/number-of-collections-not-visible-in-mongodb/36041/2 "2025-01-09T10:42:50Z")

</div>

Hello @Pramod_Kumar_Gupta, could you provide more details?

1. Steps to reproduce
2. Number of DBs and Collections in your service
3. Did you enable all collectors?

Thank you

---

<div class="post-metadata">

**Author:** ![Pramod\_Kumar\_Gupta](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/pramod_kumar_gupta/32/19488_2.png) [@Pramod\_Kumar\_Gupta](https://forums.percona.com/u/Pramod_Kumar_Gupta)\
**Post date:** [January 9, 2025, 10:48am UTC](https://forums.percona.com/t/number-of-collections-not-visible-in-mongodb/36041/3 "2025-01-09T10:48:34Z")

</div>

yes i have enbaled all collectors. I have very large number of dbs and collection alomost more than 2000.

I have the run the pmm server in docker and client is alos running in docker and mongo cluster also.

for adding i am using this

pmm-admin add mongodb --username=pmm --password=pmm --host=mongo2 mongo2 --query-source=profiler --replication-set=myReplicaSet --cluster=P1 --enable-all-collectors --max-collections-limit=50000

pmm-admin add mongodb --username=pmm --password=pmm --host=mongo3 mongo3 --query-source=profiler --replication-set=myReplicaSet --cluster=P1 --enable-all-collectors --max-collections-limit=50000

pmm-admin add mongodb --username=pmm --password=pmm --host=mongo1 mongo1 --query-source=profiler --replication-set=myReplicaSet --cluster=P1 --enable-all-collectors --max-collections-limit=50000

---

<div class="post-metadata">

**Author:** ![nurlan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/nurlan/32/1523_2.png) [@nurlan](https://forums.percona.com/u/nurlan)\
**Post date:** [January 9, 2025, 10:54am UTC](https://forums.percona.com/t/number-of-collections-not-visible-in-mongodb/36041/4 "2025-01-09T10:54:39Z")

</div>

got it, I recommend to increase metrics resolution, especially low resolution as it takes some time to collect collstats. [Configure - Percona Monitoring and Management](https://docs.percona.com/percona-monitoring-and-management/2/how-to/configure.html#metrics-resolution)
