Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-7424

Add dbStats-based metric to mongodb_exporter v0.20+



    • Type: Improvement
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: MongoDB_Exporter
    • Labels:
    • Platform Team:
      C/S Core


      mongodb_exporter v0.1x included a metric to fetch the dbStats for each database namespace on a mongod node. Or if run from mongos the merged result of that from all shards.

      In this statistics command "database" == "db namespace", not "db instance". The metric has to be fetched from each db namespace, eg. "admin", "config", "database_foo", "database_bar", "test", "local", and then summed to give the stats for the whole database node instance.

      The favourite user metric in that result is the database size (as in the uncompressed document size). But it also includes number of collections and indexes, total number of documents ("objects"), and aggregate files size.

      In the development of mongodb_exporter v0.20 I suggested we drop this metric because all the same properties are available from $collStats, or the older db.collection.stats() command. The end result for monitoring deployment data size, etc. can be achieved by summing those too.

      But then we disabled $collStat collection by default. In case there are too many collections to iterate in a reasonable amount of time.

      The big problem that is an outcome of those decisions now is that we do not have any metric being fetched by default that we can use to display database size.

      So let's fetch dbStats by default again. There is a risk it will be too slow when users have a large number of collections (say 1,000+) so let's also add a 'disable dbStats' option.




            carlos.salguero Carlos Salguero
            akira.kurogane Akira Kurogane
            0 Vote for this issue
            3 Start watching this issue



                Smart Checklist