prometheus-huey-exporter
Expose metrics from the huey task queue
Usage
Huey configuration
Create a custom signal handler that catch all the signals and publish on a specific Redis channel
@huey.signal()
def metrics(signal, task, exc=None):
# conn = djhuey.HUEY.storage.conn
conn = get_redis_connection()
data = {
'event': signal,
'task_name': task.name,
'task_id': task.id,
}
conn.publish(channel_name, json.dumps(data))
Run the exporter
Start the exporter passing the same channel_name
used in the python code
> ./prometheus-huey-exporter -redis.channel <channel_name>
Configuration parameters
Flag Name |
Environment Variable Name |
Description |
-log.level |
HUEY_EXPORTER_LOG_LEVEL |
Log level |
-log.format |
HUEY_EXPORTER_LOG_FORMAT |
Log format |
-redis.address |
HUEY_EXPORTER_REDIS_ADDR |
Address of the Redis instance to connect to |
-redis.channel |
HUEY_EXPORTER_REDIS_CHANNEL |
Redis channel to subscribe to listen for events |
-metrics.namespace |
HUEY_EXPORTER_METRICS_NAMESPACE |
Namespace for metrics |
-web.telemetry-path |
HUEY_EXPORTER_WEB_PATH |
Path under which to expose metrics |
-web.listen-address |
HUEY_EXPORTER_WEB_LISTEN_ADDRESS |
Address to listen on for web interface and telemetry |
Other Flags
Flag Name |
Description |
-version |
Show the version and quit |
-h |
Show the help and quit |