Skip to main content

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


Start HTTP service

Start the HTTP server like this:

$ bin/celery prometheus --host= --port=9691

Configure Prometheus

  - job_name: 'celery'
      - 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.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

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for celery-redis-prometheus, version 1.1.1
Filename, size File type Python version Upload date Hashes
Filename, size celery_redis_prometheus-1.1.1.tar.gz (6.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page