SQL Alerts
Not available on the Free plan (see Pricing)
SQL Alerts are a powerful way to be notified about things proactively based on data in your database. Simply write a SQL query, set a schedule and specify a condition for the results. An email will be sent each time the condition is met.
This can be useful for a lot of things, such as:
- get notified when error rates spike or when similar unexpected things happen
- get notified when your customers perform certain actions (e.g. when they start using a new feature)
- get a brief overview every morning in your email inbox of events that happened the day before
- setup data quality monitoring rules
You can specify the following options when creating / editing a SQL alert:
Name and Description can be used to describe the purpose of an alert
Trigger condition, which determines the condition which results in sending the alert:
- Query produces some rows - would trigger the alert when the sql query has 1 or more rows as an output
- Query produces no rows - would trigger the alert when the sql query has 0 rows as an output
- Value greater/lower/equal/not-equal - would trigger the alert by comparing a single numerical value as query output to the entered value. The alert is also triggered in case the query produces unexpected results (no rows, or more rows/columns than just single value)
Alert schedule determines when/how frequently the alert query is run:
- Disabled - the alert is not run automatically, but can be triggered manually from the alerts list
- Run every x minutes/hours - the alert query is run every x minutes/hours from the last time it was run. I.e. if I set the schedule to run every 24 hours, and run the alert now (e.g. by saving it), it would next run 24 hours from now
- Run every day as hh:mm - the alert would be run at the times specified - you can enter several values separated by comma in a
HH:MM
format (HH
for hours from00-23
andMM
for minutes from00-59
). The times are in the timezone specified in your Organization preferences.
Send email to is the list of alert recipients, separated by comma. Important: if no emails are specified, the alert will be run, but no emails will be sent. You can also easily get the alerts delivered to Slack channels - see a guide on how to set this up here.
Send email is used to control when an email is sent:
- When triggered - the email sent every time the trigger condition is met.
- On change only - the email only when the trigger condition changes from met/unmet state.
- On all runs - the email is sent every time the alert is run, regardless of the condition, the condition then only determines the email subject.
Datasource and Query specify the actual SQL query to run and the datasource to run it against.