// the find
percona/mongodb_exporter
A Prometheus exporter for MongoDB including sharding, replication and storage engines
A Prometheus exporter for MongoDB and Percona Server for MongoDB that walks the diagnostic commands (serverStatus, replSetGetStatus, collStats, indexStats, getDiagnosticData) and exposes nearly everything they return. It's for anyone running MongoDB/PSMDB 6.0+ in production who wants Prometheus-based monitoring, especially sharded or replicated clusters.
It derives metrics dynamically from diagnostic command output rather than hand-mapping each field, so new MongoDB metrics tend to show up without exporter code changes. Multi-target support (/scrape?target= and /scrapeall) lets one exporter instance monitor an entire fleet instead of running a sidecar per node. --compatible-mode keeps the old 0.1x metric names alive during migration, so existing dashboards and alerts don't break overnight. The PBM and shards collectors are concrete operational wins you won't get from a generic exporter — backup state and chunk distribution are things people actually page on.
collstats and shard metrics scale linearly with collection/shard count and the docs don't warn you about cardinality blowup on large sharded clusters — you have to explicitly allow-list collections, and it's easy to either forget that or over-scope it. Profile-based metrics require setting MongoDB's profiler to level 1 or 2 in production, which has its own performance cost that the README mentions only in passing. Docs are split between README.md and a separate REFERENCE.md with no clear map of which flags are cheap defaults versus expensive opt-ins. Multi-target host/cluster disambiguation (mongodb:// vs mongodb+srv:// comma-separated hosts) is fiddly to configure correctly, and misconfiguration tends to show up as silently missing metrics rather than a startup error.