From 1b65a40565d5a37ee80903fdce01383f47378369 Mon Sep 17 00:00:00 2001 From: Joel Labes Date: Wed, 27 Nov 2024 15:12:26 +1300 Subject: [PATCH] Update model-notifications --- .../docs/docs/deploy/model-notifications.md | 44 ++++++++++++++++--- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/website/docs/docs/deploy/model-notifications.md b/website/docs/docs/deploy/model-notifications.md index a6d4c467f0b..f1563afe0c7 100644 --- a/website/docs/docs/deploy/model-notifications.md +++ b/website/docs/docs/deploy/model-notifications.md @@ -33,7 +33,9 @@ Create configuration YAML files in your project for dbt to send notifications ab ## Configure groups -Add your group configuration in either the `dbt_project.yml` or `groups.yml` file. For example: +Define your groups in any .yml file in your [models directory](/reference/project-configs/model-paths). For example: + + ```yml version: 2 @@ -42,22 +44,26 @@ groups: - name: finance description: "Models related to the finance department" owner: - # 'name' or 'email' is required + # Email is required to receive model-level notifications, additional properties are also allowed. name: "Finance Team" email: finance@dbtlabs.com - slack: finance-data + favorite_food: donuts - name: marketing description: "Models related to the marketing department" owner: name: "Marketing Team" email: marketing@dbtlabs.com - slack: marketing-data + favorite_food: jaffles ``` -## Set up models + + +## Attach groups to models + +Attach groups to models as you would any other config, in either the `dbt_project.yml` or `.yml` files. For example: -Set up your model configuration in either the `dbt_project.yml` or `groups.yml` file; doing this automatically sets up notifications for tests, too. For example: + ```yml version: 2 @@ -74,6 +80,32 @@ models: group: marketing ``` + + +By assigning groups in the `dbt_project.yml` file, you can capture all models in a subdirectory at once. In the below example, all notifications related to staging models will go to the data engineering group, whereas models in `marts/sales` will be routed to the finance team. + + + +```yml +config-version: 2 +name: "jaffle_shop" + +[...] + +models: + jaffle_shop: + staging: + +group: data_engineering + marts: + sales: + +group: finance + campaigns: + +group: marketing + +``` + + +Attaching a group to a model also encompasses its tests, so you will also receive notifications for a model's test failures. ## Enable access to model notifications