1. Guides
  2. Send Slack alerts

Elementary has a Slack integration to send alerts about failures of dbt tests, Elementary tests, model runs, and source freshness.

You can customize the alerts in your .yml files by configuring:

  • Description
  • Tags
  • Owner
  • Subscribers
  • Custom channel
  • Alert fields
  • Alert filters
  • Alert grouping
  • Suppression interval
New Slack alert format

Before you start

Before you can start using the alerts, make sure to install the dbt package, configure a profile and install the CLI. This is required for the alerts to work.

Setup Slack Integration

First create a Slack app:

Based on the method you selected, create a token or webhook:

Lastly, pass the token / webhook to the CLI as a param or in the config.yml file:

Execute the CLI

Make sure to run the following command after your dbt runs and tests:

edr monitor --slack-token <your_slack_token> --slack-channel-name <slack_channel_to_post_at> --group-by [table | alert]

Or just edr monitor if you used config.yml.

Enable/disable alerts

By default, alerts are sent on failed tests, errored models and errored snapshots. You can choose to enable / disable alert types by adding a var to your dbt_project.yml.

Below are the available vars and their default config:

  # Alerts configuration vars   #
  # All set to false by default #
  disable_model_alerts: false
  disable_test_alerts: false
  disable_warn_alerts: false
  disable_skipped_model_alerts: true
  disable_skipped_test_alerts: true

Alert properties

In your .yml files, add the following properties to models / tests:

Alert configuration

Elementary allows you to customize alerts to distribute the right information to the right people. This way you can ensure your alerts are valuable and to avoid alert fatigue.

Alert on source freshness failures

Not supported in dbt cloud

To alert on source freshness, you will need to run edr run-operation upload-source-freshness right after each execution of dbt source freshness. This operation will upload the results to a table, and the execution of edr monitor will send the actual alert.

  • Note that it needs to be from the same machine.
  • Note that this requires passing --project-dir argument.

Continuous alerting

In order to monitor continuously, use your orchestrator to execute it regularly (we recommend running it right after your dbt job ends to monitor the latest data updates).

Read more about how to deploy Elementary in production. If you need help or wish to consult on this, reach out to us on Slack.