Description
Describe the bug
There is no mongodb_exporter deployment pattern for clusters provided in documentation. I can run my exporter on HA platform and i want to get cluster state. For that reason i have tried:
mongodb_exporter --mongodb.uri="mongodb://10.0.3.222:27017,10.0.1.210:27017,10.0.2.101:27017/?replicaSet=rs0" --collect-all
Result is:
ERRO[0000] Cannot connect to MongoDB: invalid MongoDB options: a direct connection cannot be made if multiple hosts are specified
I can get single exporter process working with my cluster by using --no-mongodb.direct-connect
. Some posts from Percona guys suggests we should have one exporter per node. This would complicate scraping and later on i will have metrics tripled (extra dimension being particular exporter). This is kind of dirty so it would be great to have some information about the deployment pattern. Also answer for a qestion:
Can i run with multiple cluster nodes and --no-mongodb.direct-connect
without risk of having broken metrics?
To Reproduce
Steps to reproduce the behavior:
Try running exporter against 3 node replicaset cluster.
Expected behavior
Answer provided and documentation updated.
Environment
- Linux
- mixed
- MongoDB 4.x however i feel question is quite generic
Additional context