bee-queue-prom
v1.1.0
Published
Provide prometheus metrics for Bee-Queue
Downloads
2
Maintainers
Readme
Bee-Queue Prom
Provides Prometheus metrics for Bee-Queue
Metrics:
- waiting jobs (gauge)
- active jobs (gauge)
- completed jobs (gauge)
- failed jobs (gauge)
- delayed jobs (gauge)
Usage
import Queue from 'bee-queue';
import promClient from 'prom-client';
import * as bee-queueProm from 'bee-queue-prom';
const queue = new Queue('myQueue'...);
const bee-queueMetric = bee-queueProm.init({
queue,
promClient, // optional, it will use internal prom client if it is not given
interval: 1000, // optional, in ms, default to 60000
});
bee-queueMetric.run();
// Metrics result in Promotheus
// jobs_waiting_total{queue_name="myQueue"} 0
// jobs_active_total{queue_name="myQueue"} 0
// jobs_complete_total{queue_name="myQueue"} 0
// jobs_failed_total{queue_name="myQueue"} 0
// jobs_delayed_total{queue_name="myQueue"} 0
API
init(options)
Initialize
options:
- queue (required): Bee-Queue queue
- promClient (optional): prom client instance
- interval (optional, default 5000): interval in ms to fetch the Bee-Queue statistic
run()
Start running and fetching the data from Bee-Queue based on interval
stop()
Stop running
License
MIT © Pawel Badenski
This library is largely derived from kue-prom (MIT © Budi Irawan)