diff --git a/README.md b/README.md index 6ab236f5..cbc50fa4 100644 --- a/README.md +++ b/README.md @@ -30,30 +30,55 @@ should work: couchdb-prometheus-exporter --help ```` +## Run the binary + +You can get an overview over possible configuration options with their defaults in the help screen: + + couchdb-prometheus-exporter --help + +Configuration is possible via: + +- environment variables (e.g. `COUCHDB_USERNAME=admin`) +- command line parameters (e.g. `--couchdb.username admin`) +- configuration file + +The configuration file format is the "properties" file format, e.g. like this: + +````properties +couchdb.username=admin +couchdb.password=a-secret +```` + ## Run it as container - docker run -p 9984:9984 gesellix/couchdb-prometheus-exporter --couchdb.uri=http://couchdb:5984 --logtostderr + docker run --rm -p 9984:9984 gesellix/couchdb-prometheus-exporter --couchdb.uri=http://couchdb:5984 --logtostderr + +Please note that host names like `localhost` won't leave the container, so you have to use non-loopback +dns names or ip addresses when configuring the CouchDB URI. + +## Logging The couchdb-exporter uses the [glog](https://godoc.org/github.com/golang/glog) library for logging. With the default parameters everything will be logged to `/tmp/`. Use `--logtostderr` to enable logging to stderr and `--help` to see all options. +## CouchDB 2+ clusters + For CouchDB 2.x, you should configure the exporter to fetch the stats from one node, to get a complete cluster overview. In contrast to CouchDB 1.x you'll need to configure the admin credentials, e.g. like this: - docker run -p 9984:9984 gesellix/couchdb-prometheus-exporter --couchdb.uri=http://couchdb:5984 --couchdb.username=root --couchdb.password=a-secret + couchdb-prometheus-exporter --couchdb.uri=http://couchdb:5984 --couchdb.username=root --couchdb.password=a-secret ## Database disk usage stats If you need database disk usage stats, add a comma separated list of database names like this: - docker run -p 9984:9984 gesellix/couchdb-prometheus-exporter --couchdb.uri=http://couchdb:5984 --databases=db-1,db-2 --couchdb.username=root --couchdb.password=a-secret + couchdb-prometheus-exporter --couchdb.uri=http://couchdb:5984 --databases=db-1,db-2 --couchdb.username=root --couchdb.password=a-secret Or, if you want to get stats for every database, please use `_all_dbs` as database name: - docker run -p 9984:9984 gesellix/couchdb-prometheus-exporter --couchdb.uri=http://couchdb:5984 --databases=_all_dbs --couchdb.username=root --couchdb.password=a-secret - + couchdb-prometheus-exporter --couchdb.uri=http://couchdb:5984 --databases=_all_dbs --couchdb.username=root --couchdb.password=a-secret ## Monitoring CouchDB with Prometheus, Grafana and Docker