Skip to content

Commit

Permalink
netdata couchdb plugin with conf file and app group support
Browse files Browse the repository at this point in the history
  • Loading branch information
wohali committed Sep 30, 2017
1 parent 401f467 commit 95433c5
Show file tree
Hide file tree
Showing 11 changed files with 593 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ This is a list of what it currently monitors:
- **Redis databases**<br/>
multiple servers, each showing: operations, hit rate, memory, keys, clients, slaves

- **couchdb**<br/>
reads/writes, request methods, status codes, tasks, replication, per-db, etc

- **mongodb**<br/>
operations, clients, transactions, cursors, connections, asserts, locks, etc

Expand Down
2 changes: 2 additions & 0 deletions conf.d/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dist_pythonconfig_DATA = \
python.d/apache_cache.conf \
python.d/bind_rndc.conf \
python.d/chrony.conf \
python.d/couchdb.conf \
python.d/cpufreq.conf \
python.d/dns_query_time.conf \
python.d/dovecot.conf \
Expand Down Expand Up @@ -73,6 +74,7 @@ dist_healthconfig_DATA = \
health.d/backend.conf \
health.d/bind_rndc.conf \
health.d/cpu.conf \
health.d/couchdb.conf \
health.d/disks.conf \
health.d/elasticsearch.conf \
health.d/entropy.conf \
Expand Down
2 changes: 1 addition & 1 deletion conf.d/apps_groups.conf
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ puma: *puma*
# database servers

sql: mysqld* mariad* postgres* oracle_* ora_*
nosql: mongod redis* memcached
nosql: mongod redis* memcached *couchdb*
timedb: prometheus *carbon-cache.py* *carbon-aggregator.py* *graphite/manage.py* *net.opentsdb.tools.TSDMain*

# -----------------------------------------------------------------------------
Expand Down
13 changes: 13 additions & 0 deletions conf.d/health.d/couchdb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# make sure couchdb is running

template: couchdb_last_collected_secs
on: couchdb.request_methods
calc: $now - $last_collected_t
units: seconds ago
every: 10s
warn: $this > (($status >= $WARNING) ? ($update_every) : ( 5 * $update_every))
crit: $this > (($status == $CRITICAL) ? ($update_every) : (60 * $update_every))
delay: down 5m multiplier 1.5 max 1h
info: number of seconds since the last successful data collection
to: dba
1 change: 1 addition & 0 deletions conf.d/python.d.conf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ apache_cache: no
# apache: yes
# bind_rndc: yes
# chrony: yes
# couchdb: yes
# cpufreq: yes
# cpuidle: yes
# dns_query_time: yes
Expand Down
84 changes: 84 additions & 0 deletions conf.d/python.d/couchdb.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# netdata python.d.plugin configuration for couchdb
#
# This file is in YaML format. Generally the format is:
#
# name: value
#
# There are 2 sections:
# - global variables
# - one or more JOBS
#
# JOBS allow you to collect values from multiple sources.
# Each source will have its own set of charts.
#
# JOB parameters have to be indented (using spaces only, example below).

# ----------------------------------------------------------------------
# Global Variables
# These variables set the defaults for all JOBs, however each JOB
# may define its own, overriding the defaults.

# update_every sets the default data collection frequency.
# If unset, the python.d.plugin default is used.
# By default, CouchDB only updates its stats every 10 seconds.
update_every: 10

# priority controls the order of charts at the netdata dashboard.
# Lower numbers move the charts towards the top of the page.
# If unset, the default for python.d.plugin is used.
# priority: 60000

# retries sets the number of retries to be made in case of failures.
# If unset, the default for python.d.plugin is used.
# Attempts to restore the service are made once every update_every
# and only if the module has collected values in the past.
# retries: 5

# ----------------------------------------------------------------------
# JOBS (data collection sources)
#
# The default JOBS share the same *name*. JOBS with the same name
# are mutually exclusive. Only one of them will be allowed running at
# any time. This allows autodetection to try several alternatives and
# pick the one that works.
#
# Any number of jobs is supported.
#
# All python.d.plugin JOBS (for all its modules) support a set of
# predefined parameters. These are:
#
# job_name:
# name: myname # the JOB's name as it will appear at the
# # dashboard (by default is the job_name)
# # JOBs sharing a name are mutually exclusive
# update_every: 1 # the JOB's data collection frequency
# priority: 60000 # the JOB's order on the dashboard
# retries: 5 # the JOB's number of restoration attempts
#
# Additionally to the above, the couchdb plugin also supports the following:
#
# host: 'ipaddress' # Server ip address or hostname. Default: 127.0.0.1
# port: 'port' # Rabbitmq port. Default: 15672
# scheme: 'scheme' # http or https. Default: http
# node: 'couchdb@127.0.0.1' # CouchDB node name. Same as -name vm.args argument.
#
# if the URL is password protected, the following are supported:
#
# user: 'username'
# pass: 'password'
#
# if db-specific stats are desired, place their names in databases:
# databases: 'npm-registry animaldb'
#
# ----------------------------------------------------------------------
# AUTO-DETECTION JOBS
# only one of them will run (they have the same name)
#
localhost:
name: 'local'
host: '127.0.0.1'
port: '5984'
node: 'couchdb@127.0.0.1'
scheme: 'http'
# user: 'admin'
# pass: 'password'
2 changes: 1 addition & 1 deletion diagrams/netdata-overview.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions python.d/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dist_python_DATA = \
apache_cache.chart.py \
bind_rndc.chart.py \
chrony.chart.py \
couchdb.chart.py \
cpufreq.chart.py \
cpuidle.chart.py \
dns_query_time.chart.py \
Expand Down
36 changes: 36 additions & 0 deletions python.d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,42 @@ local:

---

# couchdb

This module monitors vital statistics of a local Apache CouchDB 2.x server, including:

* Overall server reads/writes
* HTTP traffic breakdown
* Request methods (`GET`, `PUT`, `POST`, etc.)
* Response status codes (`200`, `201`, `4xx`, etc.)
* Active server tasks
* Replication status (CouchDB 2.1 and up only)
* Erlang VM stats
* Optional per-database statistics: sizes, # of docs, # of deleted docs

### Configuration

Sample for a local server running on port 5984:
```yaml
local:
user: 'admin'
pass: 'password'
node: 'couchdb@127.0.0.1'
```

Be sure to specify a correct admin-level username and password.

You may also need to change the `node` name; this should match the value of `-name NODENAME` in your CouchDB's `etc/vm.args` file. Typically this is of the form `couchdb@fully.qualified.domain.name` in a cluster, or `couchdb@127.0.0.1` / `couchdb@localhost` for a single-node server.

If you want per-database statistics, these need to be added to the configuration, separated by spaces:
```yaml
local:
...
databases: 'db1 db2 db3 ...'
```

---

# cpufreq

This module shows the current CPU frequency as set by the cpufreq kernel
Expand Down
Loading

0 comments on commit 95433c5

Please sign in to comment.