gesellix / couchdb-prometheus-exporter

CouchDB stats exporter for Prometheus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Monitoring CouchDB with Prometheus, Grafana and Docker

redgeoff opened this issue · comments

@gesellix, I just wanted to say thanks for the awesome project! I've written a post on medium that outlines how to set up Prometheus from scratch and use your exporter.

If you are interested, I could create a PR to add a link to this post on the couchdb-prometheus-exporter README.md. No pressure :)

@redgeoff hey, nice one! Only one note: you might want to mention that the exporter can be configured using a config file instead of env variables. Passing database passwords via env aren't the most secure way.
A PR to link to your article would be nice! :-)

Great point. I looked quickly at https://github.com/gesellix/couchdb-prometheus-exporter/blob/f06ba7093d9d8bcae0e9f7e83b62026ed92d2477/example-setup.md and I believe you are recommending the auth config be handled at the Docker env layer, right?

So, we'd just need a .env file like:

COUCHDB.USERNAME=root
COUCHDB.PASSWORD=secret

And then you can just use something like the following without the username and password:

docker run -p 9984:9984 gesellix/couchdb-prometheus-exporter -couchdb.uri=http://couchdb:5984

Does this seem right?

Ah, yes, that's yet another option how to pass the credentials and it's probably a bit more secure.

What I meant was more about using Docker Swarm Secrets, but that won't work for a non-Swarm setup. In fact, also forgot to enable the possibility to configure the exporter via config file. That has been fixed now, but I still need to update the example to reflect that change. For your article I would suggest to simply mention the fact that one can choose different ways of configuration (environment, command line parameters, config file).

Sorry for the confusion!

Cool, I wasn't even aware of Docker Swarm Secrets. I've mentioned both Docker Swarm Secrets and using a .env file at the bottom of the post.

Also, here's the PR :)

closing, since the PR has been merged.

@redgeoff a little follow-up on Docker Swarm: see https://github.com/gesellix/couchdb-prometheus-exporter/tree/61ae510a711e6effcdb90409a6f4f5ce76708753/examples/stack for example stacks using Swarm secrets (and configs).
Adding another service like Grafana or Prometheus shouldn't be too hard... ;-)

Ah, cool! I used docker compose a bunch and didn't even know that docker swarm has something similar.