Prompt
How do I monitor pipeline freshness and failures?
Latest observation
Oct 19, 2026
OpenAI APIWeb search: off
To monitor pipeline freshness and failures, you want two things in place:
- Freshness checks: verify the pipeline produced data recently enough.
- Failure monitoring: detect and alert when the pipeline or any critical step breaks.
1) Monitor pipeline freshness
What to measure
Track a “last successful run” timestamp for each pipeline or dataset, then compare it to an expected cadence.
Common freshness signals:
- Last successful execution time
- Data arrival time in the destination table/topic/bucket
- Max event timestamp ingested
- Row count / file count for the latest batch
- Lag between source event time and warehouse availability
Typical freshness rule
Example:
- Hourly pipeline should have completed successfully within the last 90 minutes
- Daily pipeline should have completed within the last 26 hours
How to implement
- Store metadata for each run in a pipeline metadata table
- Add a scheduled freshness check that runs every few minutes
- Trigger alerts if:
now - last_successful_run > threshold- data volume is unexpectedly zero
- newest source event is older than expected
Example logic
if current_time - last_success_timestamp > allowed_lag:
alert("Pipeline freshness breach")
2) Monitor failures
What to capture
Track failures at:
- Pipeline/job level
- Task/stage level
- Data quality level
- Infrastructure level (scheduler, compute, network, permissions)
Useful failure indicators
- Job status = failed
- Non-zero exit code
- Retries exhausted
- Task duration spike
- Missing output artifact
- Schema mismatch
- Data quality test failure
- Orchestrator missed scheduled run
Alerting strategy
Send alerts on:
- Any pipeline run failure
- Repeated transient failures
- Failure rate above threshold
- Stale pipeline freshness
- Missing expected outputs
Recommended alert severity
- Critical: production pipeline failed, no recent successful run
- High: freshness SLA breached
- Medium: repeated retries or degraded performance
- Low: non-blocking warning, partial data
3) Best practices
Centralize metrics
Use a single source of truth for:
- run status
- start/end time
- duration
- records processed
- output location
- error message
Add observability
Log:
- pipeline name
- environment
- run ID
- input/output counts
- error stack traces
- dependency status
Use dashboards
Create dashboards showing:
- last successful run by pipeline
- freshness lag
- failure counts over time
- average runtime
- SLA breaches
Set up alerts thoughtfully
Avoid alert fatigue by:
- alerting only on actionable events
- deduplicating repeated alerts
- routing different severities to different channels
4) Example monitoring setup
A simple setup could be:
- Orchestrator (Airflow/Dagster/Prefect/etc.) tracks run status
- Metadata table stores successful run timestamps
- Monitoring job runs every 5–15 minutes:
- checks freshness thresholds
- checks latest run status
- emits alerts to Slack/PagerDuty/Email
- Dashboard visualizes health trends
5) Minimal checklist
- Record every run’s start/end/status
- Track last successful run time
- Define freshness thresholds per pipeline
- Alert on failed runs and stale data
- Monitor runtime, counts, and error rates
- Build a dashboard and on-call routing
If you want, I can also give you:
- a SQL example for freshness monitoring,
- an Airflow/Dagster/Prefect implementation,
- or a cloud-native setup for AWS/GCP/Azure.