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.2.0 (2022-06-23)
Update to celery-5.x
1.1.1 (2020-03-20)
Fix py2 class syntax issues
1.1.0 (2020-03-20)
Make py2 compatible.
1.0.0 (2020-03-20)
Initial release
Metadata
Release files for celery_redis_prometheus 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| celery_redis_prometheus-1.2.0.tar.gz | 7.2 kB | Details |
Release files / celery_redis_prometheus-1.2.0.tar.gz
| Download URL | celery_redis_prometheus-1.2.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8510820c5fd59ecb7ec0c4f93ef947949a6f4a721c500ecbaac755e4c5479238
|
|
BLAKE2b-256 checksum How to use checksums |
25d5e1aaf0e0cc96d82c3010bda09cc98cc010e76aaf4d01eda9125be2f67925
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/58.2.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.13
|