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|retries-exceeded", queue="..."}, counter
celery_task_queuetime_seconds{queue}, histogram (only if task_send_sent_event is enabled in Celery)
celery_task_runtime_seconds{queue}, 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.5.2 (2026-07-27)
Remove unused setuptools dependency
1.5.1 (2023-10-27)
Fix brown-bag release
1.5.0 (2023-10-27)
Be explicit about unregistering default collectors
1.4.0 (2022-10-28)
Add queue label to task_queuetime and task_runtime metrics
1.3.0 (2022-09-14)
Add queue label to celery_tasks_total metric
Add separate state retries-exceeded (previously used failed)
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file celery_redis_prometheus-1.5.2.tar.gz.
File metadata
- Download URL: celery_redis_prometheus-1.5.2.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7db86223db87aeddcc7e43ba31fc729ce1c7523405a16ce0b62d1d59b462d3d
|
|
| MD5 |
ae865419d77ff9c4a72ad18e4848f8e7
|
|
| BLAKE2b-256 |
64a1ac2be90048ce93ebbbec4faea5087168330f83d34ebfccda34ca972c87eb
|
File details
Details for the file celery_redis_prometheus-1.5.2-py3-none-any.whl.
File metadata
- Download URL: celery_redis_prometheus-1.5.2-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26f6e1c833829a01eb48bdd6516b0994d91eafcfffdf0e8f717fa74d50f17760
|
|
| MD5 |
c25ec226af5e0a9fce3c258c982a6757
|
|
| BLAKE2b-256 |
d4ebcc54f73bcb6feecfc2efb6315e213804a3219294d0a3322ec0ac13986347
|