RQ (Redis Queue) is a simple Python library for queueing jobs. And this project aims to expose its metrics to Prometheus.
docker build -t rq-prometheus-exporter .
Pull it from dockerhub
docker pull amekss/rq-prometheus-exporter:stable
There is RQ_REDIS_URI
environment variable available to setup URL for the redis used by RQ
docker run -it --rm -p 4567:8000 rq-prometheus-exporter
where 4567
is the port on docker host you'd like to expose exporter service to.
Note: For more details on how to use docker
please head to the official documentation of Docker
rq_enqueued_jobs gauge The total number of enqueued jobs (labels: queue_name)
rq_workers gauge The number of workers performing jobs (labels: name, queues, state)
While it's good enough for setting up basic monitoring and alerting in Prometheus, in future would be good to comeback to this and check how to extend it with more metrics
docker-compose build
docker-compose up
Container will be exposed on port 4567
of docker host machine and hot reloading is enabled so all changes to code have to be seen even without restarting gunicorn process or container (it might take a few seconds for process to reload though)
docker-compose run --rm exporter pytest
Note: For more details on how to use docker-compose
please head to the official documentation of Docker Compose
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request