Mongodb_exporter metric for db size

Hi all,

I’m using the latest release of mongodb_exporter by percona (v0.20.1) an I’m looking for a metric that will show the database size as requested by the developers in my company but I can’t find any…

I do see that by using the following query in the mongo I can see some close metrics like dataSize:
db.runCommand({dbStats: 1, scale: 1})

However I can’t find an equivalent in the exporter.
Do you know of any metric that will get me this information?


Hi Dan,

Exporter generates metric mongodb_mongos_db_data_size_bytes



1 Like

Thanks for the reply!

I don’t see this metric on the exposed port of my server… maybe I’m missing something on the configuration?
I’m running the exporter with the following flags:
mongodb_exporter --mongodb.uri --compatible-mode -web.listen-address “:9001”

1 Like

Hi Dan,

Metric mongodb_mongos_db_data_size_bytes is collected for a shared cluster.
But it’s turned out that similar metric for a node (mongodb_mongod_db_data_size_bytes) doesn’t collect by the latest exporter version.
Here is the ticket regarding this issue.



I looked at the ticket and we did enable collStats but still didn’t see any dbStats metrics.
For now we went with the older exporter (0.11.2), and we’ll wait for the metrics to be available in the new exporter before we upgrade.

Thank you!

1 Like