A Prometheus exporter for MongoDB including sharding, replication and storage engines
181
Based on MongoDB exporter by David Cuadrado (@dcu), but forked for full sharded support and structure changes.
make
To define your own MongoDB URL, use environment variable MONGODB_URL. If set this variable takes precedence over -mongodb.uri flag.
To enable HTTP basic authentication, set environment variable HTTP_AUTH to user:password pair. Alternatively, you can
use YAML file with server_user and server_password fields.
export MONGODB_URL='mongodb://localhost:27017'
export HTTP_AUTH='user:password'
./mongodb_exporter <flags>
See the help page with -h.
If you use MongoDB Authorization, you must:
db.getSiblingDB("admin").createUser({
user: "mongodb_exporter",
pwd: "s3cr3tpassw0rd",
roles: [
{ role: "clusterMonitor", db: "admin" },
{ role: "read", db: "local" }
]
})
MONGODB_URL before starting the exporter:export MONGODB_URL=mongodb://mongodb_exporter:s3cr3tpassw0rd@localhost:27017
If you use x.509 Certificates to Authenticate Clients, pass in username and authMechanism via connection options to the MongoDB uri. Eg:
mongodb://CN=myName,OU=myOrgUnit,O=myOrg,L=myLocality,ST=myState,C=myCountry@localhost:27017/?authMechanism=MONGODB-X509
Point the process to any mongo port and it will detect if it is a mongos, replicaset member, or stand alone mongod and return the appropriate metrics for that type of node. This was done to prevent the need to an exporter per type of process.
If you find a bug in Percona MongoDB Exporter or one of the related projects, you should submit a report to that project's JIRA issue tracker.
Your first step should be to search the existing set of open tickets for a similar report. If you find that someone else has already reported your problem, then you can upvote that report to increase its visibility.
If there is no existing report, submit a report following these steps:
An excellent resource is Elika Etemad's article on filing good bug reports..
As a general rule of thumb, please try to create bug reports that are:
Content type
Image
Digest
Size
6.6 MB
Last updated
about 8 years ago
docker pull batazor/percona-mongodb_exporter:0.6.1.1