couchdb-prometheus-exporter
couchdb-prometheus-exporter copied to clipboard
Add maintenance metric
Hello,
I'm wondering if it's possible to get a metric for the _up page to check if a node is in maintenance mode ?
I haven't find it in the existing metrics.
Thanks, Martinho MOREIRA
That metric isn't available, yet. We only got a node_up metric as of #13.
Would you like to prepare a pull request?
Yeah if it's possible it will be great, to ensure that all nodes are up after a maintenance.
Thanks
API docs: https://docs.couchdb.org/en/stable/api/server/common.html#get--_up
If
maintenance_modeistrueornolb, the endpoint will return a 404 response.
Example response:
HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Length: 16
Content-Type: application/json
Date: Sat, 17 Mar 2018 04:46:26 GMT
Server: CouchDB/2.2.0-f999071ec (Erlang OTP/19)
X-Couch-Request-ID: c57a3b2787
X-CouchDB-Body-Time: 0
{"status":"ok", "seeds":{}}
API docs for the maintenance_mode: https://docs.couchdb.org/en/stable/config/couchdb.html#couchdb/maintenance_mode
Use case for the maintenance mode: https://docs.couchdb.org/en/2.3.1/cluster/sharding.html
The "seeds" attribute in the health response relates to the new "inital nodes" feature as of CouchDB 2.3.0: https://github.com/apache/couchdb/issues/1658 (release notes).
So, I'm finally back to your suggestion. After looking into the api docs and at the current implementation of the exporter I have to note that this feature will need another config parameter, namely a list of all node addresses. I'll check in more detail whether this is really necessary, so please bear with me :)