MongoDB Exporter missing metrics, Engine is unavailable

Hi.
We are using mongodb-exporter and we’re having issues getting some metrics. Both exporter and MongoDB cluster (sharded, 19 replicasets) are deployed on a Kubernetes cluster. Exporter is only logging such errors: “cannot retrieve engine type: Engine is unavailable”.
Also metrics per certain replicasets are missing, eg. mongodb_mongod_replset_my_state{set=“rs0”} . Moreover there’s a mismatch: mongodb_mongos_sharding_databases_total{type=“partitioned”}) returns 0 DBs while mongodb_mongos_sharding_shards_total returns 19 shards.
One observation - when using certain replicaset service uri as mongodb_uri parameter in exporter, the mongodb_mongod_replset_my_state metric works for that particular replicaset (however most of the rest of metrics not).

So, I have two questions:

  1. Are we missing something here either with the exporter or mongodb configuration etc. ?
  2. I saw that there were some changes in exporter earlier this year (related to shards) which weren’t released yet. When we can expect a new version of the exporter, is there chance it may fix our issue ? (I believe here’s a related ticket: Jira )

Exporter is configured in a such way:

  • mongodb_uri is a URI to a mongos service
  • extra args: --discovering-mode --collect-all --compatible-mode --mongodb.direct-connect

Diagnostic data and profile metrics gathering are enabled. Also the monitoring user has required privileges.
Versions:
Exporter: 0.40.0
MongoDB: 7.0.8-5 (metrics were missing also on 6.x)

Thank you in advance, Krzysztof

Hello,
I’m facing the same issue. Is there any workaround or fix available?

1 Like

Hi,
when using a newest version of the exporter (0.41.0) the engine related error is gone. Unfortunately we’re still not getting replicasets metrics eg. mongodb_mongod_replset_my_state returns only one, without set and with a value 6 which is UNKNOWN.
Running exporter with a debug logging level is giving some output, eg.
“replSetGetStatus”: {
“failed”: 701,
“total”: 701
},
which is strange, since the user has sufficient priviliges (tested manually via mongosh). Also having look at the certain rs logs there’re successful authentications of that user without any errors.
Running the exporter with a different sets of args, eg, collector.replicasetstatus only (combined with the other collectors), no-direct-connect, global-conn-pool etc. didn’t have any effect.

Could you give us some advice on our issue ?

Best regards, Krzysztof