All Projects → gesellix → couchdb-prometheus-exporter

gesellix / couchdb-prometheus-exporter

Licence: MIT license
CouchDB stats exporter for Prometheus

Programming Languages

go
31211 projects - #10 most used programming language
HTML
75241 projects
perl
6916 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to couchdb-prometheus-exporter

dicomweb-server
Lightweight DICOMweb Server with CouchDB
Stars: ✭ 74 (+64.44%)
Mutual labels:  couchdb
go-pouchdb
GopherJS bindings for PouchDB ⚠️ NOTICE ⚠️ this package has been superseded by https://github.com/go-kivik/kivik
Stars: ✭ 12 (-73.33%)
Mutual labels:  couchdb
prometheus-barman-exporter
Barman exporter for Prometheus
Stars: ✭ 23 (-48.89%)
Mutual labels:  exporter
docker-db-backup
Backup mutltiple databases types on a scheduled basis with many customizable options
Stars: ✭ 302 (+571.11%)
Mutual labels:  couchdb
sql-to-redis
🔄 Simple tool for ETL. From SQL to Redis.
Stars: ✭ 18 (-60%)
Mutual labels:  exporter
sohva
CouchDB asynchronous client for Scala
Stars: ✭ 21 (-53.33%)
Mutual labels:  couchdb
mq-java-exporter
Exporter for IBM MQ metrics https://prometheus.io/
Stars: ✭ 19 (-57.78%)
Mutual labels:  exporter
Kitura-CouchDB
CouchDB adapter for Kitura
Stars: ✭ 50 (+11.11%)
Mutual labels:  couchdb
tucan-tools
Nomen est omen. It exports tucan grades/vv etc.
Stars: ✭ 24 (-46.67%)
Mutual labels:  exporter
couchdb dart
A library for Dart developers for work with CouchDB
Stars: ✭ 47 (+4.44%)
Mutual labels:  couchdb
couch-auth
Powerful authentication for APIs and apps using CouchDB (or Cloudant) with Node >= 14
Stars: ✭ 50 (+11.11%)
Mutual labels:  couchdb
treeio
🌱 Base Classes and Functions for Phylogenetic Tree Input and Output
Stars: ✭ 70 (+55.56%)
Mutual labels:  exporter
prometheus-logstash-exporter
Prometheus exporter for Logstash metrics
Stars: ✭ 54 (+20%)
Mutual labels:  exporter
io scene pbrt
Exporter for blender that exports the scene into pbrt's ascii file format.
Stars: ✭ 42 (-6.67%)
Mutual labels:  exporter
hospitalrun-core
All elements shared between Frontend and Backend, including CouchDB design-documents and schemas.
Stars: ✭ 36 (-20%)
Mutual labels:  couchdb
use-pouchdb
React Hooks for PouchDB
Stars: ✭ 39 (-13.33%)
Mutual labels:  couchdb
ansible-process exporter
Provision process exporter for prometheus monitoring tool
Stars: ✭ 16 (-64.44%)
Mutual labels:  exporter
couchdb-couch-plugins
Mirror of Apache CouchDB
Stars: ✭ 14 (-68.89%)
Mutual labels:  couchdb
discord-channel-archiver
A small discord bot to archive the messages in a discord text channel.
Stars: ✭ 34 (-24.44%)
Mutual labels:  exporter
sqs-exporter
A Prometheus Exporter for the Amazon Simple Queue Service (SQS)
Stars: ✭ 24 (-46.67%)
Mutual labels:  exporter

CouchDB Prometheus Exporter

Build Status

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.

Build the binary

You can find pre-build releases for different platforms at our GitHub Releases.

If you prefer to build your own binary or in case you'd like to build from the current master, you'll have to get and install a recent version of Golang for your platform, first. Then, you have to perform the following commands in the cloned repository:

export GO111MODULE=on  # in a Windows shell, please replace `export` with `set`
go get github.com/gesellix/couchdb-prometheus-exporter

Those commands will install the binary in your local GOBIN directory, usually something like $HOME/go/bin. Please ensure that the directory is in your system's PATH. Then the following 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 (e.g. --config=config.ini)

The configuration file format is the "properties" file format, e.g. like this:

couchdb.username=admin
couchdb.password=a-secret

Using TLS and/or Basic authentication

TLS and/or Basic authentication is supported via --web.config parameter:

couchdb-prometheus-exporter --config=config.ini --web.config=web-config.yaml

A complete web-config.yml might look like this:

---
tls_server_config :
  cert_file : "path/to/https/server.crt"
  key_file : "path/to/https/server.key"
basic_auth_users:
  alice: $2y$12$1DpfPeqF9HzHJt.EWswy1exHluGfbhnn3yXhR7Xes6m3WJqFg0Wby
  bob: $2y$18$4VeFDzXIoPHKnKTU3O3GH.N.vZu06CVqczYZ8WvfzrddFU6tGqjR.
  carol: $2y$10$qRTBuFoULoYNA7AQ/F3ck.trZBPyjV64.oA4ZsSBCIWvXuvQlQTuu
  dave: $2y$10$2UXri9cIDdgeKjBo4Rlpx.U3ZLDV8X1IxKmsfOvhcM5oXQt/mLmXq
...

For further information about TLS and/or Basic auth, please visit: exporter-toolkit/https or github.com/prometheus/exporter-toolkit.

Run it as container

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 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:

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:

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:

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

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

Examples

The examples directory in this repository contains ready-to-run examples for

Credits

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!

Metrics Overview

The file README_metrics.md gives you an overview on the currently exposed metrics.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].