Skip to main content

celery_redis_prometheus

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.1.0 (2020-03-20)

  • Make py2 compatible.

1.0.0 (2020-03-20)

  • Initial release

Metadata

Release files for celery_redis_prometheus 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for celery_redis_prometheus 1.1.0
File Size Uploaded
celery_redis_prometheus-1.1.0.tar.gz 6.1 kB Details

Release files / celery_redis_prometheus-1.1.0.tar.gz

Download URL celery_redis_prometheus-1.1.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5ce6df6ebd512f14f9690d74058bc82be04540d27ee63cbdfa347a9dd9b9cef6
BLAKE2b-256 checksum
How to use checksums
9f25bb8d4f06ea92d05e8ff2f125ef07e0934838b55dda13cdba1d9d9a4808c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.7

Release history Release notifications | RSS feed

2.0.0

2 release files

1.5.2

2 release files

1.5.1

1 release file

1.5.0

1 release file

1.4.0

1 release file

1.3.0

1 release file

1.2.0

1 release file

1.1.1

1 release file

This release

1.1.0 This release

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page