Background jobs guide
How to Monitor Background Jobs
Background job monitoring combines execution evidence, business completion, logs and metrics. A heartbeat is one useful signal in that set.
Know which failure you are detecting
A worker can be dead, alive but blocked, processing the wrong queue, repeatedly failing a job or completing work with an invalid result. A single green process check cannot distinguish these cases.
Use a small evidence set
- worker process and queue state;
- job start, completion and failure logs;
- queue depth, duration and retry metrics;
- application-level completion checks;
- heartbeats from the worker or scheduler.
Where heartbeats help
Place a heartbeat after a worker reaches a meaningful checkpoint, or after a scheduled process completes its own validation. The receiving service can then reason about missing evidence without opening an inbound connection to the worker.
Do not overread the signal
A heartbeat is not a trace and does not validate every job result. Keep the payload small and carry only the context needed to correlate the event with your own logs. See secure signal relay and heartbeat monitoring.