Group alerts from different tables
Is your feature request related to a problem? Please describe. I'm receiving an overwhelming number of alerts for tests that are related to the same upstream data issues.
Here's an illustrative example: My project uses medallion architecture. If I'm missing an account in the bronze layer, then my accounts test fails in bronze.customers, silver.customers, and gold.customers.
Describe the solution you'd like I want the option to generate only a single slack alert notifying me that the accounts test failed across all the layers to which it is applied. This assumes that a single test is parameterized so that it can be applied to all three layers. The alert could look like this:
dbt test alert
test: accounts
status: fail
date: 2023-09-26
table(s): [bronze.customers, silver.customers, and gold.customers]
columns: [bronze.customers.accounts, silver.customers.accounts, and gold.customers.accounts]
tags: ['accounts']
description: failed test indicates that accounts are missing
Likewise, I'd like to be able to include multiple related tests into a single alert. For example, if I was not able to parameterize a single test into all three layers, but instead had three separate tests, I'd still like to show them in single alert. The alert could look like this:
dbt test alert
tests: [accounts_bronze, accounts_silver, accounts_gold]
status: fail
date: 2023-09-26
table(s): [bronze.customers, silver.customers, and gold.customers]
columns: [bronze.customers.accounts, silver.customers.accounts, and gold.customers.accounts]
tags: ['accounts']
description: failed test indicates that accounts are missing
Describe alternatives you've considered I've considering modifying the data in the ELEMENARY.ALERTS table to force alerting into the format I'm requesting. I would update the ELEMENTARY.ALERTS table with a dbt post-hook.
Additional context
Would you be willing to contribute this feature? Maybe. Depends on complexity and time constraints.