Save the History
Catch the Hole Before Somebody Else Does
Collectors Die Quietly
A key expires. A password changes. The vendor renames a field. The script stops, nobody notices, and four months later there's a hole in the middle of your chart.
The trap is that zero calls and broken collector look the same in the data. So write a line for every run:
| Run | Result | Calls saved | Meaning |
|---|---|---|---|
| Sunday 2 AM | ok | 0 | Quiet day |
| Monday 2 AM | failed | 0 | Broken, go look |
| Tuesday 2 AM | no line at all | It never ran |
The third one is the worst, because a program that isn't running can't tell you it isn't running. Something else has to notice: a separate check that alerts you when there's been no good run in 26 hours (a daily job, plus two hours of slack).
Look for Empty Days
This lists every day in the last 30 with no saved calls (Postgres; use your own time zone):
with today as (
select (now() at time zone 'America/New_York')::date as day
)
select d::date as empty_day
from today,
generate_series(today.day - 30, today.day - 1, interval '1 day') as d
left join calls c
on (c.started_at at time zone 'America/New_York')::date = d::date
group by d
having count(c.record_id) = 0
order by d;
Weekends and holidays may be fine. A Tuesday isn't. Empty days catch only total loss, though. A half-saved day still has rows, so once a week compare one day's count with the vendor's screen too.
Put AI on It
Add a run log: start time, end time, date range asked for,
records received, records saved, ok or failed, error text.
Write the row even when zero records come back.
Add a separate check that alerts me if there is no ok run in 26 hours.
Then show me how to break it on purpose so I can see the alert fire.
An alert you've never seen fire is a guess. Turn the collector off on purpose, once, and wait for it.
Why log a run that saved zero calls?