1. Guides
  2. Send Slack alerts

Elementary has a Slack integration to send alerts about failures in dbt tests, Elementary tests, models runs and snapshots runs.

The alerts include information for fast triage. Also, you can add configuration for each test / model in your .yml files:

  • Custom channels - distribute alerts based on their context
  • Owners - tag the owner of the model
  • Subscribers - let users subscribe to models and tests they care about
  • dbt Tags - add custom context to the alert
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

Alert types configuration

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

dbt_project.yml

            
              
              
            
            
          vars:
  # Alerts configuration vars   #
  # All set to false by default #
  elementary:
    disable_model_alerts: false
    disable_test_alerts: false
    disable_warn_alerts: false

Customize alerts: owners, tags and subscribers

Elementary enriches alerts with dbt model/source/snapshot owners and tags (see dbt’s docs to learn more). Also, you can use two custom Elementary fields:

  • Subscribers: to tag additional users except the owner in an alert.
  • Channel: to send the alert to additional Slack channel (only available for Slack token).

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). If you need help or wish to consult on this, reach out to us on Slack.