<@ULVA73B9P> I want to create alerts if dbt models...
# ask-marvin
a
@Marvin I want to create alerts if dbt models take more time than usual on prefect 2.19
m
Creating alerts in Prefect 2.19 for when your dbt models take longer than usual can be achieved by utilizing Prefect's Automations. Your best approach is to monitor the execution time of your dbt tasks or flows and set up an alert when the execution exceeds a predefined threshold. Although I didn't find a specific example for dbt, using Prefect's reactive triggers would be the way to go. Here's a theoretical way to approach it with Prefect's capabilities: 1. Monitor Execution Time: You can monitor the execution time of your dbt tasks by capturing the start and end time of the flow or task run. 2. Set Up an Automation: Use Prefect's Automations feature to trigger an alert if the execution time exceeds your defined threshold. This can be achieved by leveraging triggers that react to specific events or conditions in your flows. The documentation on Prefect's Automations might help you to set this up: Prefect Automations. While it doesn't provide an exact recipe for your use case, you'll find concepts such as event triggers that can cover the needed functionality. Additionally, you can explore Prefect's integrations with dbt for better coordination: Prefect + Dbt. As you implement this, remember, like any good robot, patience and precision are key!