Coder Social home page Coder Social logo

rangermeier / celery-prometheus-exporter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zerok/celery-prometheus-exporter

0.0 1.0 0.0 12 KB

A simple Prometheus-compatible metrics exporter for Celery

License: MIT License

Makefile 9.28% Python 89.70% Shell 1.01%

celery-prometheus-exporter's Introduction

celery-prometheus-exporter

celery-prometheus-exporter is a little exporter for Celery related metrics in order to get picked up by Prometheus. As with other exporters like mongodb_exporter or node_exporter this has been implemented as a standalone-service to make reuse easier across different frameworks.

So far it provides access to the following metrics:

  • celery_tasks exposes the number of tasks currently known to the queue seperated by state (RUNNING, STARTED, ...).
  • celery_workers exposes the number of currently probably alive workers

How to use

There are multiple ways to install this. The obvious one is using pip install celery-prometheus-exporter and then using the celery-prometheus-exporter command:

$ celery-prometheus-exporter
Starting HTTPD on 0.0.0.0:8888

This package only depends on Celery directly, so you will have to install whatever other dependencies you will need for it to speak with your broker ๐Ÿ™‚

Alternatively, you can use the bundle Makefile and Dockerfile to generate a Docker image.

If you want the HTTPD to listen to another port, use the --addr option.

By default, this will expect the broker to be available through redis://redis:6379/0. If you're using AMQP or something else other than Redis, take a look at the Celery documentation and install the additioinal requirements ๐Ÿ˜Š Also use the --broker option to specify a different broker URL.

If you then look at the exposed metrics, you should see something like this:

$ http get http://localhost:8888/metrics | grep celery_
# HELP celery_workers Number of alive workers
# TYPE celery_workers gauge
celery_workers 1.0
# HELP celery_tasks Number of tasks per state
# TYPE celery_tasks gauge
celery_tasks{state="PENDING"} 0.0
celery_tasks{state="STARTED"} 0.0
celery_tasks{state="SUCCESS"} 0.0
celery_tasks{state="FAILURE"} 0.0
celery_tasks{state="RECEIVED"} 0.0
celery_tasks{state="REVOKED"} 0.0
celery_tasks{state="RETRY"} 0.0

Limitations

  • Among tons of other features celery-prometheus-exporter doesn't support stats for multiple queues. As far as I can tell, only the routing key is exposed through the events API which might be enough to figure out the final queue, though.
  • This has only been tested with Redis so far.

celery-prometheus-exporter's People

Contributors

zerok avatar

Watchers

 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.