Collect dbt source freshness results
Add the following flag to your dbt_project.yml
file:
This flag enables Elementary to automatically collect source-freshness
results, just like any other test results.
In dbt versions lower than 1.8, the results of the command dbt source-freshness
are not automatically collected.
You can collect the results using the Elementary CLI tool.
If dbt source freshness results are collected, they will be presented in the UI, and in alerts upon failure.
dbt core users
To alert on source freshness, you will need to run the following command:
The command needs to be executed after you run dbt source freshness
and before executing edr monitor
.
This operation will upload the results to a table, and the execution of edr monitor
will send the actual alert.
- Note that
dbt source freshness
andupload-source-freshness
needs to run from the same machine. - Note that
upload-source-freshness
requires passing--project-dir
argument.
dbt Cloud users
The results can't be collected from dbt Cloud. Here is a suggestion from an Elementary user for a solution you can implement.
Need help?
Reach out to the Elementary team to consult on implementing dbt source freshness collection as an Elementary Cloud user.