Exports task execution metrics in Prometheus format
Project description
Exports task execution metrics in Prometheus format: how many tasks were started and have completed successfully or with failure, and how many tasks are still in the queues (supported only for broker redis).
Inspired by https://gitlab.com/kalibrr/celery-prometheus
Usage
Start HTTP service
Start the HTTP server like this:
$ bin/celery prometheus --host=127.0.0.1 --port=9691
Configure Prometheus
scrape_configs: - job_name: 'celery' static_configs: - targets: ['localhost:9691']
We export the following metrics:
celery_tasks_total{state="started|succeeded|failed|retried"}, counter
celery_task_queuetime_seconds, histogram (only if task_send_sent_event is enabled in Celery)
celery_task_runtime_seconds, histogram
If you pass --queuelength-interval=x then every x seconds the queue lengths will be checked (NOTE: this only works with redis as the broker), resulting in this additional metric:
celery_queue_length{queue="..."}, gauge
Run tests
Using tox and py.test. Maybe install tox (e.g. via pip install tox) and then simply run tox.
celery_redis_prometheus changes
1.0.0 (2020-03-20)
Initial release
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for celery_redis_prometheus-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77abc98745b9405122b05bc49ed6b81e433a2f6c515784293a7fa8a91dcdb4f2 |
|
MD5 | 325e7f79d08a218cb7a26d613f05acd1 |
|
BLAKE2b-256 | 6daa1ff48e16806db8e35cf47b387c41192fc091be8b900abedd8e10b234841b |