Bull Prom

Provides Prometheus metrics for Bull
Metrics
| jobs_completed_total | counter | Total number of completed jobs |
| jobs_active_total | counter | Total number of active jobs (currently being processed) |
| jobs_delayed_total | counter | Total number of jobs that will run in the future |
| jobs_failed_total | counter | Total number of failed jobs |
| jobs_waiting_total | counter | Total number of jobs waiting to be processed |
| jobs_duration_milliseconds | summary | Processing time for completed/failed |
| jobs_waiting_duration_milliseconds | summary | Waiting time for completed/failed |
| jobs_attempts | summary | Processing time for completed/failed/jobs |
IMPORTANT: If you are using this library to track job duration metrics for a queue for multiple consumers you will need to listen to the global:completed event. Otherwise this library will not record job duration metrics. To listen to this event instead of the completed event you'll need to set the init paremeter useGlobal to true.
Usage
import Queue from 'bull';
import promClient from 'prom-client';
import * as bullProm from 'bull-prom';
const queue = new Queue('myQueue'...);
const bullMetric = bullProm.init({
promClient,
interval: 1000,
useGlobal: false,
});
const started = bullMetric.start(queue);
started.stop();
API
init(options)
Initialize
options:
promClient (optional): prom client instance
interval (optional, default 60000): interval in ms to fetch the Bull statistic
useGlobal (optional, default false)
start(queue)
Start running and fetching the data from Bull based on interval with the given Bull queue.
Returns a queue metrics object which includes the following methods:
stop(): stops monitoring the queue metrics
remove(): removes metrics from prometheus
Contributors
- @mjgp2
- @robbiet480
- @TotallyNotElite
- @ejhayes
License
MIT © Pawel Badenski
This library is largely derived from kue-prom (MIT © Budi Irawan)