Configuration for Slack module¶
This module creates and sends a short report on the latest dbt test results to a specific Slack channel via a Slack bot
Slack requirements¶
- A dedicated channel for this module messages
- A dedicated Slack app in the channel & app token.
- Creating a Slack app βοΈ
- Getting your app token βοΈ
Slack module config variables & CLI commands¶
SLACK_TOKEN
: your Slack bot token (e.g.xxxx-123456789101-12345678910-XXXXXXXXXXXXXXXXXXXXXXX
)SLACK_CHANNEL
: your Slack channel (e.g. your_channel_name)
All Slack configs are currently environment variables, you can set them up using the sample code below:
export SLACK_TOKEN=xxxx-123456789101-12345678910-XXXXXXXXXXXXXXXXXXXXXXX
export SLACK_CHANNEL=your_channel_name
To alert to Slack, use the following:
Slack message body¶
Our default Slack message consists of:
- Thread's header + timestamp
- A quick summary:
errors
,warnings
,passes
, anddeprecations
count. - Top 3 issues:
- If you have previously defined
Priority
field in your custom Query, these are the 3 issues with the highest priority. - If not, it's πrandom π
Sample Slack message¶
Summary on 2023-11-10 05:47:42.571000:
- 3 error(s)
- 3 warning(s)
- 2 pass(es)
- 0 deprecation(s)
Top 3 Issues:
- [1] :large_yellow_circle: | Warning in test: accepted_values_my_first_dbt_model_id__False__1__2.ee252c12b8 [dq-tools]
- [2] :large_yellow_circle: | Warning in test: accepted_values_my_first_dbt_model_id__False__1__2.ee252c12b8 [dq-tools]
- [3] :large_yellow_circle: | Warning in test: accepted_values_my_first_dbt_model_id__False__1__2.ee252c12b8 [dq-tools]