Git Product home page Git Product logo

celery-cloudwatch's Introduction

image

image

image

image

This is a simple monitoring tool that intercepts the results of Celery tasks and uploads the result to AWS CloudWatch.

Installation

Install from PyPi:

pip install celery-cloudwatch-logs

Configuration

Configuration is done through environment variables. The following environment variables must be set in order for celery-cloudwatch to work:

  • AWS_CLOUDWATCH_ACCESS_KEY
  • AWS_CLOUDWATCH_SECRET_KEY
  • AWS_CLOUDWATCH_GROUP_NAME

AWS_CLOUDWATCH_ACCESS_KEY and AWS_SECRET_KEY are optional. If not specified, Boto3 will handle the configuration for these keys, as described here:

http://boto3.readthedocs.io/en/latest/guide/configuration.html

Optionally, the following environment variables may be set:

  • REDIS_URL="redis://"
  • AWS_CLOUDWATCH_REGION="eu-west-1"

The CloudWatch log group does not have to exist. If it doesn't exists, it will be created.

Running

$ celery cloudwatch

This requires you to have ran setup.py or installed this package through pip. Alternatively, run:

$ python -m celery_cloudwatch

How it works

Celery CloudWatch connects to your broker and monitors tasks in real time. When a task succeeded, failed was rejected or revoked, it uploads all available information about that task into a log stream on AWS CloudWatch Logs.

Based on the specified log group name in the AWS_CLOUDWATCH_GROUP_NAME, a log group will be created. For each possible result, a separate log stream is created. For each task result, an entry is added to the log stream associated with the result.

Known issues

  • --broker on celery cloudwatch is ignored.
  • No descriptive way to specify other brokers than Redis.

All brokers supported by Celery will work, simply specify the broker URL through the REDIS_URL environment variable.

celery-cloudwatch's People

Contributors

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