Loading...
Loading...
Quick data freshness check. Use when the user asks if data is up to date, when a table was last updated, if data is stale, or needs to verify data currency before using it.
npx skill4agent add astronomer/agents checking-freshness_loaded_at_updated_at_created_atupdated_atcreated_atmodified_atload_dateetl_timestampingestion_timedateevent_datetransaction_dateSELECT
MAX(<timestamp_column>) as last_update,
CURRENT_TIMESTAMP() as current_time,
TIMESTAMPDIFF('hour', MAX(<timestamp_column>), CURRENT_TIMESTAMP()) as hours_ago,
TIMESTAMPDIFF('minute', MAX(<timestamp_column>), CURRENT_TIMESTAMP()) as minutes_ago
FROM <table>SELECT
DATE_TRUNC('day', <timestamp_column>) as day,
COUNT(*) as row_count
FROM <table>
WHERE <timestamp_column> >= DATEADD('day', -7, CURRENT_DATE())
GROUP BY 1
ORDER BY 1 DESC| Status | Age | Meaning |
|---|---|---|
| Fresh | < 4 hours | Data is current |
| Stale | 4-24 hours | May be outdated, check if expected |
| Very Stale | > 24 hours | Likely a problem unless batch job |
| Unknown | No timestamp | Can't determine freshness |
list_dagsget_dag_detailsget_dag_statsFRESHNESS REPORT
================
TABLE: database.schema.table_name
Last Update: 2024-01-15 14:32:00 UTC
Age: 2 hours 15 minutes
Status: Fresh
TABLE: database.schema.other_table
Last Update: 2024-01-14 03:00:00 UTC
Age: 37 hours
Status: Very Stale
Source DAG: daily_etl_pipeline (FAILED)
Action: Investigate with **debugging-dags** skill