dbt freshness checks compare the most-recent load time of source tables against user-defined SLA thresholds to flag stale data.
dbt freshness measures how up-to-date a source table is by validating its latest timestamp against warning and error thresholds you define in YAML.
dbt freshness is a built-in validation that scans a source table’s loaded_at field and raises warnings or errors when data becomes older than expected.
Fresh data underpins reliable dashboards and machine-learning features. Automating staleness checks with dbt ensures teams catch upstream pipeline failures before stakeholders make decisions on outdated numbers.
During dbt run or dbt source freshness, dbt issues a single SQL query per source to fetch MAX(loaded_at_field). It then compares that timestamp to the current warehouse time and your YAML thresholds.
Add loaded_at_field and freshness blocks to your sources.yml. Set warn_after and error_after with time and count units so dbt knows when to alert.
sources:
- name: stripe
freshness:
warn_after: {count: 15, period: minute}
error_after: {count: 30, period: minute}
tables:
- name: payments
loaded_at_field: processed_at
Run dbt source freshness --select stripe.payments
. dbt prints a color-coded table, making it easy to validate thresholds before committing.
Include dbt source freshness
in your CI job. Fail the pipeline on freshness errors and send Slack or PagerDuty alerts so incidents are triaged quickly.
Choose a loaded_at_field that updates only on successful ingest, align thresholds with business SLAs, and store freshness artifacts for observability dashboards.
Using a nullable timestamp, setting aggressive thresholds, or ignoring timezone conversions often leads to false alerts. Validate fields and timezones in staging first.
After a dbt run, load the generated JSON artifacts into Galaxy. The IDE’s AI Copilot summarizes freshness failures and lets you drill into offending rows with one click, accelerating root-cause analysis.
Fresh data drives trustworthy analytics. Without freshness checks, stale upstream tables silently corrupt metrics, leading to bad decisions. dbt freshness automates staleness detection, letting teams enforce data SLAs and react before users notice discrepancies.
Run them at the same cadence as your ELT jobs—usually hourly or daily—to catch delays quickly without overloading the warehouse.
dbt exits with a non-zero code, marks the source as error or warn in the artifact JSON, and prints a red status line so CI jobs can fail fast.
Galaxy ingests dbt artifacts, highlights failing sources, and opens a query tab pre-populated with SQL to inspect the latest 100 rows, speeding up debugging.
Each check issues a single MAX timestamp query, which is lightweight. Even dozens of sources usually cost pennies per day on cloud warehouses.