Skip to content
Telemetry
Event tracking template

Background job failure monitor

Capture queue, cron, import, billing sync, and webhook job health from the first run through retries and failures.

Reviewed by the Telemetry product team on . We checked the event names, suggested fields, questions to query, and data to exclude. Who reviews this page

Questions you can answer
  • Which jobs are failing repeatedly?
  • Which queues are falling behind?
  • Which job names have the worst p95 duration?
How to test this template

Set up Background job failure monitor and check the results

Use the prompt to add events, then check the stored fields and query results. Review the event definitions before relying on the numbers.

  1. 1

    Choose when to log

    Instrument the point where job_started becomes final.

  2. 2

    Create the contract

    Start with job_started, job_completed, job_failed and keep every field typed, bounded, and privacy-reviewed.

  3. 3

    Run a fixture

    Exercise known success, failure, retry, and empty-result cases before relying on aggregate results.

  4. 4

    Answer the question

    Which jobs are failing repeatedly?

Template versus use case

Use this template to add events

Copy this template when the measurement goal is already clear. Use the matching use-case guide to review event boundaries, success definitions, and the decisions the resulting SQL should support.

Read Background job monitoring

Template

Paste this into your coding agent

Replace YOUR_API_KEY, run the flow locally, then verify the generated events and dashboards.

job-failure-monitor

Background job failure monitor

text
Instrument background jobs with Telemetry.

Use /skill.md and this Telemetry API key: YOUR_API_KEY

Log job_started, job_completed, job_failed, job_retried, and dead_letter_created with:
job_name, queue_name, attempt, status, duration_ms, scheduled_at, started_at, completed_at, item_count, retry_count, worker_name, and error_type.

Create queries and a dashboard for throughput by job, failures by job, p95 duration, retry volume, stalled jobs, and newest dead-letter events.

Do not log raw job payloads, credentials, webhook bodies, or customer content.

Events to capture

job_startedjob_completedjob_failedjob_retrieddead_letter_created

Verification checklist

Check the events, queries, and dashboard

Events

Synthetic events reach the intended table with stable names and field types.

Queries

The first SQL queries return plausible rows with an explicit time window.

Views

A dashboard uses the real fields and includes enough context to explain a change.

Safety

You checked that events exclude prompts, bodies, credentials, signatures, and private content.

Example event schemas

Check what each event records, when to send it, and which field types it needs. Review the example payload and privacy checklist before using it in production.

Use these queries in Telemetry

Learn about Alerts

Add a threshold and recipients to your reliability query to get alerts.

Related SQL recipes

More SQL recipes

Run the query using this workflow's event fields and check the example result. Save the result to a dashboard or set up an alert.

Browse all recipes
Recipe collectionsBackground jobs SQL

More templates