Skip to content

Commit

Permalink
Update Readme with more hints about configuration options
Browse files Browse the repository at this point in the history
  • Loading branch information
gesellix committed May 18, 2020
1 parent 230e954 commit 55bb8a6
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 55bb8a6

Please sign in to comment.