Docs · Integrations
BullMQ
Watch every BullMQ job scheduler with the pingding npm package.
Published at launch as the npm package
pingding.
monitorWorker reports a BullMQ worker's job schedulers. Each scheduler is one check; each scheduled job is one run, with retries counted as part of it.
import { Worker } from "bullmq";
import { monitorWorker } from "pingding/bullmq";
const worker = new Worker("emails", processor, { connection });
const monitor = monitorWorker(worker, { token: process.env.PINGDING_API_TOKEN });
// On shutdown: let the worker finish, then the pings.
await worker.close();
await monitor.close();
With a team API token (member role), each scheduler gets a check of its own the first time one of its jobs runs, with a matching schedule. Without a token, give each scheduler's ping key yourself:
monitorWorker(worker, { keys: { "nightly-report": process.env.REPORT_PING_KEY } });
Requirements
- Node 22.21 or newer. No dependencies of its own.
- BullMQ 5.16 or newer, or 6.x, with job schedulers.
Options
| Option | Environment | What it is |
|---|---|---|
token |
PINGDING_API_TOKEN |
A team API token: turns on automatic checks. |
apiUrl |
PINGDING_API_URL |
A self-hosted API's address. |
pingBaseUrl |
PINGDING_PING_BASE_URL |
Where pings go, if not the default. |
keys |
Ping keys by scheduler id. | |
scope |
Tells apart deployments that share queue names, such as staging and production. |
|
grace |
Grace for created checks, in seconds. | |
sendErrors |
Send a failed job's error with its ping (default on). |
What it sends
/startwhen an occurrence first becomes active.- Success when the job completes.
/fail, with the error's message, once the job has failed for good (after its retries).
If PingDing can't be reached, jobs run exactly as before; only pings are lost, with a warning in your logs.