percona / mongodb_exporter

A Prometheus exporter for MongoDB including sharding, replication and storage engines
Apache License 2.0
1.16k stars 425 forks source link

Fix/ignore views for list collections #892

Closed ramunas-omnisend closed 4 weeks ago

ramunas-omnisend commented 4 weeks ago

When listCollections is executed, it may encounter views, which can cause errors such as:

ERRO[0016] cannot get $collstats cursor for collection <database>.<view>: (CommandNotSupportedOnView) Namespace <database>.<collection> is a view, not a collection

This fix filters out views when listing collections, preventing these errors from appearing in the logs.

it-percona-cla commented 4 weeks ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 3 committers have signed the CLA.

:white_check_mark: ramunas-omnisend
:x: zygis
:x: ritmas
You have signed the CLA already but the status is still pending? Let us recheck it.

ramunas-omnisend commented 4 weeks ago

will open another PR