Skip to main content
Version:
1.1.2
Web:

https://django-celery-monitor.readthedocs.io/

Download:

https://pypi.python.org/pypi/django_celery_monitor

Source:

https://github.com/jezdez/django-celery-monitor

Keywords:

django, celery, events, monitoring

Build status coverage BSD License django-celery-monitor can be installed via wheel Supported Python versions. Support Python implementations.

About

This extension enables you to monitor Celery tasks and workers.

It defines two models (django_celery_monitor.models.WorkerState and django_celery_monitor.models.TaskState) used to store worker and task states and you can query this database table like any other Django model. It provides a Camera class (django_celery_monitor.camera.Camera) to be used with the Celery events command line tool to automatically populate the two models with the current state of the Celery workers and tasks.

History

This package is a Celery 4 compatible port of the Django admin based monitoring feature that was included in the old django-celery package which is only compatible with Celery < 4.0. Other parts of django-celery were released as django-celery-beat (Database-backed Periodic Tasks) and django-celery-results (Celery result backends for Django).

Installation

You can install django_celery_monitor either via the Python Package Index (PyPI) or from source.

To install using pip,:

$ pip install -U django_celery_monitor

Usage

To use this with your project you need to follow these steps:

  1. Install the django_celery_monitor library:

    $ pip install django_celery_monitor
  2. Add django_celery_monitor to INSTALLED_APPS in your Django project’s settings.py:

    INSTALLED_APPS = (
        ...,
        'django_celery_monitor',
    )

    Note that there is no dash in the module name, only underscores.

  3. Create the Celery database tables by performing a database migrations:

    $ python manage.py migrate django_celery_monitor
  4. Go to the Django admin of your site and look for the “Celery Monitor” section.

Starting the monitoring process

To enable taking snapshots of the current state of tasks and workers you’ll want to run the Celery events command with the appropriate camera class django_celery_monitor.camera.Camera:

$ celery -A proj events -l info --camera django_celery_monitor.camera.Camera --frequency=2.0

For a complete listing of the command-line options available see:

$ celery events --help

Configuration

There are a few settings that regulate how long the task monitor should keep state entries in the database. Either of the three should be a datetime.timedelta value or None.

  • monitor_task_success_expires – Defaults to timedelta(days=1) (1 day)

    The period of time to retain monitoring information about tasks with a SUCCESS result.

  • monitor_task_error_expires – Defaults to timedelta(days=3) (3 days)

    The period of time to retain monitoring information about tasks with an errornous result (one of the following event states: RETRY, FAILURE, REVOKED.

  • monitor_task_pending_expires – Defaults to timedelta(days=5) (5 days)

    The period of time to retain monitoring information about tasks with a pending result (one of the following event states: PENDING, RECEIVED, STARTED, REJECTED, RETRY.

In your Celery configuration simply set them to override the defaults, e.g.:

from datetime import timedelta

monitor_task_success_expires = timedelta(days=7)

Metadata

Release files for django_celery_monitor 1.1.2

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

Source distribution (sdist)

Source distribution for django_celery_monitor 1.1.2
File Size Uploaded
django_celery_monitor-1.1.2.tar.gz 62.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django_celery_monitor 1.1.2
File Interpreter ABI Platform
django_celery_monitor-1.1.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 82.8 kB

Release files / django_celery_monitor-1.1.2.tar.gz

Download URL django_celery_monitor-1.1.2.tar.gz
Size 62.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a044fac92828e609c37675a12d6c0ef82bd519823ca1ef41ea48e246092e27b2
BLAKE2b-256 checksum
How to use checksums
f64a22e250bd9da9e288481fdeacd7be9bdf8382cee4949aafce05880939f862
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_celery_monitor-1.1.2-py2.py3-none-any.whl

Download URL django_celery_monitor-1.1.2-py2.py3-none-any.whl
Size 20.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8671f83564886479435b2a0db81571c0806cc6999e0b2881658c14065a6cf9ce
BLAKE2b-256 checksum
How to use checksums
e3fa0cc3884d6b97f8f95ea326474ccf20067b006601f8d08226b34e16295d3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

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