Skip to main content

Celery Prometheus

This module expose the Prometheus HTTP server to expose metrics of your Celery backends.

To install celery-prometheus with pip, use the command:

pip install celery-prometheus

With Poetry:

poetry add celery-prometheus

Usage

To setup celery-prometheus to your backend, simply call the method add_prometheus_option after the init of the Celery object.

Example:

from celery import Celery
from celery_prometheus import add_prometheus_option

app = Celery()
add_prometheus_option(app)

# Rest of your code ...

Before starting your backend, you will need to expose the PROMETHEUS_MULTIPROC_DIR environment variable to indicate which folder the Prometheus Client will use to store the metrics (see Multiprocess Mode (E.g. Gunicorn) of the Promehteus Client documentation).

To start and expose the Prometheus HTTP Server, you need to use the --prometheus-collector-addr argument when starting your Celery backend:

export PROMETHEUS_MULTIPROC_DIR=/var/cache/my_celery_app
celery worker -A my_celery_backend.backend --prometheus-collector-addr 0.0.0.0:6543

Now that your backend is started, you can configure your Prometheus scrappers to scrappe your Celery backend.

Contributions

This project is open to external contributions. Feel free to submit us a Pull request if you want to contribute and improve with us this project.

In order to maintain an overall good code quality, this project use the following tools:

Linting and formatting tools are configured to match the current default rules of Black.

We also use Mypy as a static type checker.

Please ensure to run these tools before commiting and submiting a Pull request. In case one of these mentionned tools report an error, the CI will automatically fail.

If you're making your first contribution to this project, please add your name to the contributors list.

License

This project is released by Gandi.net tech team under the BSD-3 license.

Metadata

Release files for celery-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-prometheus 1.1.0
File Size Uploaded
celery_prometheus-1.1.0.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for celery-prometheus 1.1.0
File Interpreter ABI Platform
celery_prometheus-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 8.4 kB

Release files / celery_prometheus-1.1.0.tar.gz

Download URL celery_prometheus-1.1.0.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3e98120009884415070fcfb789bd9befa58947f85475989677fd81d9a58d6796
BLAKE2b-256 checksum
How to use checksums
b7e427927cf6c1bc3e86321a97ef0584ef520c6f7f8cf544b1f6dcb90c8318be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.6 Linux/6.6.4-arch1-1

Release files / celery_prometheus-1.1.0-py3-none-any.whl

Download URL celery_prometheus-1.1.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5e3d140b184cdbf136f20ad82880be6d118a3813b0a03ee10adfe6820735b5e9
BLAKE2b-256 checksum
How to use checksums
493bd8d070810b2cecd63e6fa624be6261f92f3c4a96aedd79367421df37e224
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.6 Linux/6.6.4-arch1-1

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.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