Metacenta

Source monitoring · rule source-no-freshness

dbt sources with no freshness check

A Metacenta review checks this under the rule Sources have a freshness threshold. Everything below applies whether or not you ever commission one.

What this rule checks

This rule flags every dbt source table with no freshness threshold: no warn_after or error_after. A threshold set on the source group and inherited by the table counts.

Why it matters

If the upstream feed stops, every downstream number goes stale with no error. The dashboards keep rendering yesterday's data as today's, and nothing fails.

How to fix it

Add freshness monitoring to the ingested sources. Set freshness: with warn_after and error_after on the source, and run dbt source freshness on a schedule so the threshold is actually checked.

Before:

sources:
  - name: shop
    tables:
      - name: orders

After:

sources:
  - name: shop
    loaded_at_field: _loaded_at
    freshness:
      warn_after: {count: 6, period: hour}
      error_after: {count: 24, period: hour}
    tables:
      - name: orders

When it is fine to leave

A static reference table that is loaded once, such as a list of countries, has nothing to be fresh about. The rule still flags it, so write the reason in the table's description and the gap reads as a decision.

What we need to check it

manifest.json alone, which dbt parse writes.

Published rules it corresponds to

dbt_project_evaluator, rule fct_sources_without_freshness. Ours checks the same condition and threshold.

This means our check corresponds to their rule. It does not mean the publisher reviewed or endorses it.