Source freshness

When a Bolt schedule is configured to include the command dbt source freshness for each run you can see the state of each of your sources included in the run.

This is to help you determine the status of your source data and whether it is in line with your SLAs.

How to configure source freshness

To configure source freshness for your dbt™️ sources, add a freshness block to your source and a loaded_at_field.

  • In the freshness block, you can use warn_after and / or error_after to define the severity.

  • The loaded_at_field is required to calculate freshness for a table defined in your sources. If a loaded_at_field is not provided, then dbt will not calculate freshness for the table.

Example source freshness

models/sources.yml
sources:
  - name: analytics_raw
    freshness: # default freshness
      warn_after: {count: 12, period: hour}
      error_after: {count: 24, period: hour}
    loaded_at_field: fivetran_loaded_at

    tables:
      - name: orders
        freshness: # make this a little more strict
          warn_after: {count: 6, period: hour}
          error_after: {count: 12, period: hour}

      - name: customers # this will use the freshness defined above

      - name: product_skus
        freshness: null # do not check freshness for this table

Last updated