Skip to main content

CSF Ranch

Project description

Ranch

Standardized tooling, monitoring, and retry logic for use with Celery. fork of https://github.com/managedbyq/mbq.ranch

Installation

Ranch is a Django application. To use Ranch with Celery, add the following to your settings file:

INSTALLED_APPS = [
    ...
    'csf.ranch'
]

RANCH = {
    'env': ENV_NAME,  # e.g. production, development
    'service': MY_SERVICE_NAME,  # e.g. backend
}

Features

Metrics

Any application with Ranch installed will have Celery metrics available in the Celery/Ranch Datadog Dashboard.

Monitors

You may set up monitors for your application using the metrics provided by Ranch.

Dead Letter Queue

Celery jobs that fail will be stored in the application's database for inspection and reprocessing. Ranch provides an Admin interface for this.

See backends's Ranch Admin for an example.

Correlation IDs

Ranch can flow correlation IDs through your Celery jobs. Ranch will not change any of your logging configuration, so you'll still need to do that as part of your correlation ID implementation.

To use the correlation ID functionality, add the following settings:

RANCH = {
    ...,
    'correlation': {
        'getter': getter_fn,  # callable with no args that returns the current correlation ID
        'setter': setter_fn,  # callable with one arg which should be set as the current correlation ID
    },
}

Supplemental Error Tagging

Ranch provides a hook to add additional tagging information to error item metrics.

To use this feature, add the following settings:

RANCH = {
    ...,
    # tags_fn takes a single arg (the Ranch Task object that failed)
    # and should return a list of strings in the format "tag_name:tag_value"
    'extra_error_queue_tags_fn': tags_fn,
}

Project details


Download files

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

Source Distribution

csf_ranch-1.1.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

csf_ranch-1.1-py2.py3-none-any.whl (14.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file csf_ranch-1.1.tar.gz.

File metadata

  • Download URL: csf_ranch-1.1.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for csf_ranch-1.1.tar.gz
Algorithm Hash digest
SHA256 ad22e3224bda072121b43c94b3794383d1e26cf791253ecc35ef42cf7c1c5b06
MD5 34e6504ea2a4fc97a4873e5015dc591a
BLAKE2b-256 356e472c226189f9c8d31fd069fb673de58665fa391b57e23c7d1a457ae582c9

See more details on using hashes here.

File details

Details for the file csf_ranch-1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: csf_ranch-1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.6

File hashes

Hashes for csf_ranch-1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 036dc689e05d61934bcc04491097f381a7ea6f958fd094bf3ac29d780c29af9b
MD5 bf0a686b473861feefafb4b0b3956ebe
BLAKE2b-256 1b602d304b56c98f5cf8029e8efcc692f22aa07ffba5c608ef8452c9de50787c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page