Hi, i'm looking for a way to route my alerts into ...
# community-support
i
Hi, i'm looking for a way to route my alerts into different Slack channels. for example, i have a dedicated slack channel for each business unit in my company (finance, operation, etc). these channels correspond to all the dbt models related to this unit, and i want to send a notification to the dedicated channel when a certain model tests are failing. what are my options? is there a way to tag channels in the elementary alert? or to run erd monitor that will monitor a specific models?
👀 1
o
Hi @Itay Dar! there are couple of options and you can choose which one to choose based on how you manage your dbt project and models. If your project is organized in folders based on your business unit domains you can define it in your dbt_project.yml as follows -
Copy code
models:
  finance:
    +meta:
      channel: finance_data_ops
  marketing:
    +meta:
      channel: marketing_data_ops
This will send alerts for all the model errors and the test failures to the relevant channel based on the location of the model in your project. If the model is under the finance folder all the alerts will go to the
finacne_data_ops
channel. If you want to limit it only to test alerts, you can do it in your dbt_project.yml as follows (note the tests section) -
Copy code
tests:
  finance:
    +meta:
      channel: finance_data_ops
  marketing:
    +meta:
      channel: marketing_data_ops
With this method you can invoke one
edr monitor
command and it will route the alerts to the relevant channels based on the config that you have in your project. You can also define the custom channel in the model itself under the config or meta sections for both models and tests (see this to learn more). If you don't define it for a test but you defined it for a model - we will use the model channel for its associated tests. Another possible approach is to use tags and our edr selectors as follows -
Copy code
edr monitor --select tag:finance --slack-channel-name finance_data_ops
edr monitor --select tag:marketing --slack-channel-name marketing_data_ops
With this method you will need to execute
edr monitor
command per channel one after another
i
Thank you @Or Avidov for the response, it was extremely helpful!