Skip to content

Monitoring

GET /api/jobs/queue-stats (admin-only, gated by the ADMIN_EMAILS allowlist) returns live queue depth plus a 24-hour rollup through the IJobQueueStats port (PgBossQueueStats / InMemoryQueueStats). The dashboard home surfaces it as a “Queue health” card.

const stats = await client.jobs.getQueueStats()
// → per-queue depth + 24h completed / failed counts

Inspecting a single job

The job aggregate exposes predicates and accessors the SDK mirrors:

const job = await client.jobs.get(jobId)
client.jobs.getProgress(job) // 0–100
client.jobs.getCurrentStep(job) // string | null
client.jobs.isRunning(job)
client.jobs.isCompleted(job)
client.jobs.hasFailed(job)
client.jobs.getErrors(job) // string[] (from job.result?.errors)

For long-running work, pollForCompletion and waitForCompletion resolve once the job reaches a terminal state.