Details
Details
Assignee
Unassigned
UnassignedReporter
sebastian.neumann@experienceone.com
sebastian.neumann@experienceone.comPriority
Components
Labels
Needs QA
Yes
Needs Doc
Yes
Environment
Amazon Linux instance
mongodb_exporter (version=0.7.0, branch=v0.7.0, revision=e9fda63e88dfa3ce8e851b061ca995557b5071d0)" source="mongodb_exporter.go:103"
time="2019-04-04T22:38:24Z" level=info msg="Build context (go=go1.11.5, user=travis@build.travis-ci.org, date=20190311-17:55:22)"
Created April 4, 2019 at 11:46 PM
Updated March 27, 2024 at 2:59 PM
Hey guys,
thanks for the work on the mongodb-exporter. I was able to get everything set up but ran into an issue that I was not able to resolve. The ports are as follows:
mongos: 27017
mongod configserver: 27019
mongod replica set 1: 27018
mongod replica set 2: 27020
Environment:
We run a sharded 3 node cluster with a single mongos in front of it that accepts and distributes incoming application requests to the mongod nodes. We have two replica sets spread across the 3 cluster nodes. All mongo nodes run 3.2.21.
Steps:
Initially I only put the exporter on the mongos instance but soon realized that I was not getting mongod metrics - database and collection metrics were available though. I then rolled out the mongodb-exporter on each mongod node.
Since I did not want to have to distinguish between mongos and mongod nodes from a configuration perspective, I changed the mongodb uri to include all relevant ports of our setup:
/usr/local/bin/mongodb_exporter --mongodb.uri=mongodb://localhost:27017,localhost:27018,localhost:27019,localhost:27020 --collect.database --collect.collection --collect.topmetrics --collect.indexusage --web.listen-address=0.0.0.0:9216
The exporter runs and can be scraped successfully:
time="2019-04-04T22:38:24Z" level=info msg="Starting mongodb_exporter (version=0.7.0, branch=v0.7.0, revision=e9fda63e88dfa3ce8e851b061ca995557b5071d0)" source="mongodb_exporter.go:103" time="2019-04-04T22:38:24Z" level=info msg="Build context (go=go1.11.5, user=travis@build.travis-ci.org, date=20190311-17:55:22)" source="mongodb_exporter.go:104" time="2019-04-04T22:38:24Z" level=info msg="Starting HTTP server for http://0.0.0.0:9216/metrics ..." source="server.go:121"
If I run a Prometheus query to check the replica sets I only see one set (mgo_rs1 is missing):
Query: mongodb_mongod_replset_my_name{cluster="shared-development"} Result: mongodb_mongod_replset_my_name{cluster="shared-development",instance="inst-int-mgo1a",job="mongodb-exporter",name="172.16.44.136:27018",set="mgo_rs0"} mongodb_mongod_replset_my_name{cluster="shared-development",instance="inst-int-mgo2a",job="mongodb-exporter",name="172.16.44.139:27018",set="mgo_rs0"} mongodb_mongod_replset_my_name{cluster="shared-development",instance="inst-int-mgo3a",job="mongodb-exporter",name="172.16.44.140:27018",set="mgo_rs0"}
My assumption is that running a single exporter is fine for this use case since the cli help lists this schema:
[mongodb://][user:pass@]host1[:port1][,host2[:port2],...][/database][?options]
Please let me know what I can do to help you help me