Ondra Paul
04/24/2025, 3:08 PMkapa.ai
04/24/2025, 3:08 PMkapa.ai
04/24/2025, 3:09 PMyaml models: finance: +meta: channel: finance_data_ops marketing: +meta: channel: marketing_data_ops Or specifically for tests: yaml tests: finance: +meta: channel: finance_data_ops marketing: +meta: channel: marketing_data_ops You can also configure channels at the model level with tags and then use selectors: edr monitor --select tag:finance --slack-channel-name finance_data_ops edr monitor --select tag:marketing --slack-channel-name marketing_data_ops ### Important Notes 1. You need to make sure the Elementary app is added to all the Slack channels you want to send alerts to. 2. When using custom channels, you still need to specify a default channel with --slack-channel-name for alerts that don't match any specific channel configuration. 3. Currently, Elementary doesn't support sending a single alert to multiple Slack channels simultaneously. If you're looking to differentiate between environments (dev/prod), you can use Jinja templating in your channel configuration: yaml meta: alerts_config: channel: "{{ 'prod-alerts' if target.name == 'prod' else 'dev-alerts' }}"Ondra Paul
04/24/2025, 3:14 PMkapa.ai
04/24/2025, 3:14 PMkapa.ai
04/24/2025, 3:14 PM--slack-channel-name parameter of the edr monitor command. Here's an example of how to configure a custom Slack channel in a singular test: sql {{ config( severity = 'error', meta = { 'channel': 'custom-test-alerts' } ) }} -- Your test SQL query here However, there's an important step to make this work properly. After configuring your test, you need to run the following commands to ensure Elementary picks up your custom channel configuration: 1. dbt run --select dbt_tests dbt_models (to update Elementary's metadata tables with your new configuration) 2. dbt test --select <your_singular_test> (to run your test) 3. edr monitor ... (to send alerts) This is necessary because Elementary needs to reload your updated test configuration so it can be used properly by the edr command [Slack forum user question](https://slack.com/archives/C02CTC89LAX/p1663081786725149). Also note that if you have an alerts_config section at the test level without a channel, it will override any channel configuration at the model level. Elementary doesn't currently merge configurations from different hierarchies - the more granular level simply overrides the upper levels [Slack forum user question](https://slack.com/archives/C02CTC89LAX/p1675932347555719). The configuration hierarchy from least to most specific is: - edr command channel (default) - dbt_project.yml alerts config - specific model alerts config - specific test alerts config The more granular definition always overrides the less granular one. I hope this helps clarify how custom channel configuration works with Elementary Data! Is there anything else you'd like to know about configuring alerts in Elementary?