CouchDB metrics exporter for Prometheus
The CouchDB metrics exporter requests the CouchDB stats from the /_stats
and /_active_tasks
endpoints and
exposes them for Prometheus consumption. You can optionally monitor detailed database stats like
disk and data size to monitor the storage overhead. The exporter can be configured via program parameters,
environment variables, and config file.
docker run -p 9984:9984 gesellix/couchdb-prometheus-exporter --couchdb.uri=http://couchdb:5984 --logtostderr
The couchdb-exporter uses the 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.
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
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
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
For a step-by-step guide, see Monitoring CouchDB with Prometheus, Grafana and Docker
A complete example stack including multiple CouchDB instances, exporters, Prometheus, Grafana, etc. is available at examples/grafana/
, and can be deployed locally:
cd examples/grafana
docker swarm init
docker stack deploy --compose-file docker-traefik-stack.yml example
The examples
directory in this repository contains ready-to-run examples for
Thanks go to the Prometheus team, which is very active and responsive!
I also have to admit that the couchdb-prometheus-exporter code is heavily inspired by the other available exporters, and that some ideas have just been copied from them.
Last but not least, this project wouldn't be possible without users submitting issues, feature requests and adding code contributions. Thanks a lot!
The file README_metrics.md gives you an overview on the currently exposed metrics.