-
Notifications
You must be signed in to change notification settings - Fork 439
Document running exporter with --no-mongodb.direct-connect and multiple mongo servers in uri #971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
were you able to figure this out? I'm looking for a correct approach to monitor a cluster as well |
@dima-sh-papaya unfortunately no |
eventually it worked for me with 'srv' record (also was able to run with mongodb:// only but needed to specify '/?ssl=true' and it only allows to insert this param when using single node and not many with comma, so i ended up using the 'srv' record and the key was flags of the exporter, without the correct flags combination it won't work out of the box, very strange stuff but glad i figured it out, will share below). here's my current mode:
these are values of the helm chart i deployed with. so the '--no-mongodb.direct-connect' is mandatory when using 'srv' record (because that record first need to be resolved into the multiple actual shard addresses) and '--mongodb.global-conn-pool' helps to avoid many separate connections but I don't remember if it worked without it or not, I think can work also without. and the collector flags are optional of course, but unless you specify at least one of them, there will be no mongo metrics in the exporter only golang and process metrics of exporter itself. |
the metrics we get are separated by labels with names of shards so there's good stream of metrics and no duplication or any issue, every shard has separate label value, it also shows things like what's primary and secondary replica in labels etc' for example
it's from atlas cloud mongo though, I think for the local one it might need a different setting 🤔 just sharing this because people will land here from google search and it might help someone :) |
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:
Result is:
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
Additional context
The text was updated successfully, but these errors were encountered: