- Track the average of a numeric ML feature over time.
- Track average revenue by region, to see a sudden increase or drop in one region.
- Track the number of new unique users in a source table, to catch a problem before it reaches downstream models.

Setting up a custom SQL monitor
-
Navigate to the table or transformation model (dbt model, SQLMesh model, Coalesce node) where you want to set up the monitor and click
Add Monitor
-
Select
Custom SQLto start creating a custom SQL monitor
-
Configure the monitor with the relevant settings

- SQL metric: an aggregate SQL expression that returns one number, for example
avg(revenue). - Time partition: the timestamp column that splits the data into periods, for example
creation_date. - Delay: the number of recent periods to skip, if fresh data arrives late. See Time dimensions and scheduling.
- Detection mode: see Detection modes below.
- Sensitivity: see Configuring monitor sensitivity.
- Custom filter: a SQL condition that limits the rows the metric is computed on.
- SQL metric: an aggregate SQL expression that returns one number, for example
-
Select a
variableto segment by (optional). This will create multiple time series for each segment you select to include- To create a monitor for specific segments, toggle
Selected valuesand select the desired values. - If you select
All values, new values are automatically added.

- To create a monitor for specific segments, toggle
-
Click
continueto set up the monitor with the specified configurations
A custom monitor splits your data into time partitions by the selected timestamp column, and each partition is one point in the time series. On its first run, the monitor reads the recent history of the table. After that it queries only the newest partition, to keep query costs low. This means the monitor can detect anomalies right after you set it up.
Detection modes
Custom SQL, custom volume and custom freshness monitors support three detection modes:Anomaly detectionlearns the expected range from the history of the metric and alerts when a value falls outside it. This is the default, and the only mode that uses sensitivity.Numeric changealerts when the value changes by more than the minimum or maximum you set between two measurements in a row.Fixed thresholdsalerts when the value is below the minimum or above the maximum you set.
Resetting a monitor
If you changed historical data and want the monitor to learn it again, open the monitor, clickSettings, and press Reset monitor. A reset cannot be undone, so only reset if you are sure.