The problem I’m having
In my Azure based Data Platform, I have DataDog monitoring the Azure Data Factory pipelines which trigger / orchestrate my dbt jobs. When ADF triggers a dbt job, it waits until it completes & catches if it fails. When a job fails, DataDog calls me out via PagerDuty for investigation.
This works well HOWEVER, sometimes I need dbt to abort a job (i.e. freshness / tests) and not execute subsequent models (to save credits) but I don’t want it to trigger a call out. Is there a way to abort a dbt job without triggering a failure ?
The context of why I’m trying to do this
see above
What I’ve already tried
I can’t see an option to stop a job other than a model failing…
Some example code or error messages
N/A
A couple of thoughts that are worth looking into:
Prevent models running when tests fail
If you use dbt build, any models whose tests fail will prevent downstream nodes from being built, which will save you those credits
Only run fresh models
Check out the docs on source_status:fresher which will only select nodes where there is fresh data compared to the last production run
hey Joel. Thanks for your response.
I get that failed jobs will prevent downstream nodes from being run. That’s what I want too… but is there a way to prevent downstream nodes from being run WITHOUT triggering a FAILURE? ie. ABORT or EXIT type of operation… this way, the pipeline isn’t seen as a failure(because it didn’t fail…)
Hmm not inside of dbt Core, but outbound webhooks in dbt Cloud will enter general availability tomorrow. Perhaps you could listen for the run complete webhook, then download the artifacts from the Cloud API and check those to see why the error occurred, only raising a PagerDuty alarm if something else is the cause of the issue?