GithubHelp home page GithubHelp logo

mbq.ranch's Introduction

Ranch

Standardized tooling, monitoring, and retry logic for use with Celery

Installation

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

INSTALLED_APPS = [
    ...
    'mbq.ranch'
]

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

Features

Metrics

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

Monitors

TODO: Include link to Invoice's monitors once they're built

You may set up monitors for your application using the metrics provided by Ranch. To get started, you might want to copy Invoicing's monitors.

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 OS Core'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. This is used in OS Core to tag each error as belonging to a specific team.

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"
    # See OS Core's usage for an example
    'extra_error_queue_tags_fn': tags_fn,
}

mbq.ranch's People

Contributors

pastromhaug avatar mattbriancon avatar tayloraburgess avatar jreut avatar thieman avatar

Watchers

Andy S. Parsons avatar Michael Louis Thaler avatar Phil Sarin avatar James Cloos avatar  avatar Mark Kinney avatar Sasha Konovalova avatar  avatar Alex Figueroa avatar Talha Ghaffar avatar fp avatar Lauren Kroenung avatar  avatar  avatar  avatar Dave Anderson avatar zorawar avatar Skyler Sin avatar Osmar Coronel avatar Alex Markowitz avatar Chris Raveendra avatar Stephanie Chen avatar  avatar Ngozi Nwogwugwu avatar Dianna avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.