mongodb_exporter icon indicating copy to clipboard operation
mongodb_exporter copied to clipboard

Add config option to restrict collection to specific databases

Open msmerc opened this issue 3 years ago • 2 comments

Right now you can configure the exporter to monitor specific collections, but this is verbose if you want to monitor all the collections but only in a certain database.

Would we add an option to specify the databases to monitor and the exporter could discover all the collections within that database?

msmerc avatar Jul 23 '21 14:07 msmerc

Hello, I think this is a good option and it shouldn't be hard to implement.

percona-csalguero avatar Aug 04 '21 20:08 percona-csalguero

you can use wildcards to select all collections in a database. This worked for me to get metrics on all collections in the "yaron" database: --mongodb.collstats-colls=yaron.* --mongodb.indexstats-colls=yaron.*" Maybe this needs to be added to the documentation, but I think this solves the ticket, or am I missing something?

yaron avatar Aug 19 '21 07:08 yaron