Skip to content

Latest commit

 

History

History
90 lines (63 loc) · 2.67 KB

README.md

File metadata and controls

90 lines (63 loc) · 2.67 KB

Huey Prometheus Exporter

This project provides metrics about the huey task queue for prometheus.

Latest Version: 1.0.3


Important
  • If you use huey 1.x then install huey-exporter 0.2.2. Checkout the git tag 0.2.2.
  • If you use huey 2.x then install huey-exporter >= 1.0.

Requirements

Usage

Installation

Installation of the latest release:

pip install git+https://github.com/APGSGA/[email protected]

Installation of the master branch:

pip install git+https://github.com/APGSGA/huey-exporter.git@master

The command huey_exporter will start a webserver (default port 9100) and serves the metrics.

The exporter will explore the Redis instance and therefore find the huey queue names by themself.

Running

Usage: huey_exporter [OPTIONS]

Options:
  -c, --connection-string TEXT  Connection string to redis including database.
                                for example redis://localhost:6379/0
  -p, --port TEXT               Port to expose the metrics on.
  --logging-level               Logging level of the exporter. Default is INFO.
                                DEBUG | INFO | WARNING | ERROR
  --help                        Show this message and exit.

Example:

huey_exporter

The huey_exporter can also be configured by the environment variables REDIS_CONNECTION_STRING, LOGGING_LEVEL and EXPORTER_PORT

Docker

Image on dockerhub

The usage is the same as the non-docker.

Example:

docker run -e REDIS_CONNECTION_STRING=redis://somehost:6379/0 apgsga/huey-exporter

Exposed Metrics

  • hueyx_signals

Labels: 'queue_name', 'task_name', 'signal', 'hueyx_environment'.

  • hueyx_queue_task_count

Labels: 'queue_name', 'task_name'


Internals

huey-exporter consists of two modules which work completely independent of each other.

Signal listener

The signal listener subscribes to the hueyx hueyx.huey2.signaling pubsub. Everytime hueyx receives a huey signal the exporter receives it and increases the according prometheus counter.

Queue length

The second exporter module is the queue_length counter. The counter first tries to find huey queues on redis by watching all redis keys with the pattern huey.redis.*. The key only exists if the queue contains at least one element so it can take some time. The counter reads all tasks then and reports them to prometheus.