Background Job Monitoring: from implementation to decision
A complete background job monitoring measurement loop connects one owned workflow, a bounded event contract, a controlled fixture, and a question someone can act on.
- 1
Set the boundary
Log job_started, job_completed, job_failed, and job_retried.
- 2
Capture the outcome
Begin with job_started, job_completed, job_failed and document the grain of each event.
- 3
Prove the rows
Add alerts for stalled jobs, repeated failures, and dead-letter creation.
- 4
Make the decision
Which jobs fail or retry most often?
Use case versus template
This page explains what to measure and why
Use the use-case guide to choose outcomes, event boundaries, and analysis questions. Open the matching template when you are ready for a shorter copy-paste implementation brief.
Agent prompt
Paste this into your coding agent
Replace YOUR_API_KEY after signup, then ask the agent to run the product flow and verify the first events.
Background Job Monitoring setup prompt
Instrument background jobs and async workers with Telemetry.
Use /skill.md and this Telemetry API key: YOUR_API_KEY
Please log job_started, job_completed, and job_failed events with job_name, queue_name, attempt, status, duration_ms, scheduled_at, started_at, completed_at, item_count, retry_count, and error_type.
Create a dashboard showing throughput by job, failures by job, p95 duration, retry volume, oldest pending job, and dead-letter events. Add alerts for stalled jobs and repeated failures.Setup steps
- 1Log job_started, job_completed, job_failed, and job_retried.
- 2Include queue, job name, attempt, duration, item count, and error type.
- 3Build a dashboard for throughput, failures, retries, and p95 duration.
- 4Add alerts for stalled jobs, repeated failures, and dead-letter creation.
Events to capture
Questions unlocked
- Which jobs fail or retry most often?
- Which queues are falling behind?
- Which customers are affected by failed background work?
Event schema starting points
Event contracts for this workflow
Review the row grain, emit boundary, required types, privacy classes, example payload, and validation checklist before adapting a query or snippet to production.
Related product capability
Continue this workflow in Alerts
Promote the reviewed reliability query into an owned threshold and response workflow.
Related SQL recipes
Answer the next question with SQL
Run the query against the structured fields from this workflow, inspect the example result, and turn a useful answer into a dashboard or alert.
Measure Background Job Retry and Failure Rate
Which background jobs consume the most retries or still fail?
Open recipeFind Stalled Background Jobs With SQL
Which jobs started but never produced a terminal event?
Open recipeMeasure Queue Wait Time by Job
Which jobs wait longest before a worker starts them?
Open recipeMeasure Dead-Letter Queue Growth
Which queues are adding dead-letter jobs faster than they are resolving them?
Open recipeDetect Missed Cron Schedules
Which scheduled jobs ran later than their documented interval?
Open recipeDetect Background-Job Retry Storms
Which job types are spending the most work on retries right now?
Open recipeCustomer evidence
Related workflows described by customers
Next step
Create the API key your agent will use
The free plan is enough to run the prompt, send test events, and review the first dashboard.
Related pages
Crypto And Onchain Automation Monitoring
Track indexed events, agent actions, transaction costs, wallet workflows, tool calls, and failed automation jobs.
Open pageClaude Code Observability
Give Claude Code a prompt that makes telemetry part of the implementation pass instead of a separate cleanup project.
Open pageCodex Instrumentation Prompt
A focused prompt that asks Codex to instrument the rest of the product, verify events, and summarize coverage gaps.
Open page