couchdb-prometheus-exporter icon indicating copy to clipboard operation
couchdb-prometheus-exporter copied to clipboard

Add maintenance metric

Open moreiramarti opened this issue 6 years ago • 4 comments

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

moreiramarti avatar Jul 18 '19 09:07 moreiramarti

That metric isn't available, yet. We only got a node_up metric as of #13. Would you like to prepare a pull request?

gesellix avatar Jul 18 '19 09:07 gesellix

Yeah if it's possible it will be great, to ensure that all nodes are up after a maintenance.

Thanks

moreiramarti avatar Jul 18 '19 09:07 moreiramarti

API docs: https://docs.couchdb.org/en/stable/api/server/common.html#get--_up

If maintenance_mode is true or nolb, 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).

gesellix avatar Jul 18 '19 13:07 gesellix

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

gesellix avatar Sep 04 '19 13:09 gesellix