Skip to content
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Anomaly Detection for Data Observability Monitors
description: "Understand how the anomaly detection model works for Data Observability monitors, including training, model states, seasonality, and metric-specific behaviors."
description: "Understand how the anomaly detection model works for Data Observability monitors, including training, model states, seasonality, metric-specific behaviors, and the AI review of flagged points."
further_reading:
- link: '/data_observability/quality_monitoring/'
tag: 'Documentation'
Expand All @@ -10,19 +10,30 @@ further_reading:
text: 'Data Observability Monitor'
---

**Note**: This page applies to anomaly-based Data Observability monitors only. If your monitor uses the **Threshold** detection method, this content does not apply.
**Note**: This page applies to anomaly-based Data Observability monitors only. If your monitor uses the {{< ui >}}Thresholds{{< /ui >}} detection method, this content does not apply.

## Overview

By default, [Data Observability monitors][1] use an anomaly detection model tailored to common patterns in data quality metrics such as table freshness and row count.

The model learns from the metric's history to set expected bounds. When an observed value falls outside those bounds, the monitor triggers an alert.
The model learns from the metric's history to set expected bounds. When an observed value moves outside those bounds, an [AI reviewer](#ai-review-of-flagged-points) checks the point. The monitor alerts unless the reviewer finds that the value matches the metric's normal behavior.

## Training period

When you create an anomaly detection monitor, it enters a training period. During training, the monitor collects historical values to learn the metric's baseline behavior. It does not trigger alerts during this period, and the monitor chart appears in blue.

Training typically takes between 3 and 9 days. Because many data pipelines behave differently on weekends, the model needs to observe both weekday and weekend behavior.
Training typically takes 3 to 7 days for a monitor that runs more than once a day. A monitor that runs once a day typically trains for about 9 days. Because many data pipelines behave differently on weekends, the model needs to observe both weekday and weekend behavior. A monitor leaves training when it has both of the following:

- At least nine evaluations over at least 3 days.
- A full weekend and a full weekday of evaluations, or more than 7 days of history.

Some monitors follow different rules:

- **Freshness**: The monitor stays in training until it observes at least one table update. If it has observed only one update, it stays in training until three times the longest observed time between updates has passed since that update.
- **Row Count**: In its first 7 days, the monitor stays in training on Saturdays and Sundays until it has evaluated on three weekend days. If the row count has stayed flat since before Monday, the monitor stays in training until the count changes or Monday ends (UTC). This hold ends after 8 days of history.
- **Custom SQL with the Default model**: The monitor stays in training until it has at least 7 days of history.
- **Single-value metrics**: If the metric has only returned one value, the monitor stays in training until it has at least 7 days of history.
- **Job duration**: Each job stays in training until it has at least five completed runs over at least 1 day. It also needs a full weekday (Monday through Friday) of runs, or more than 7 days of history. It doesn't wait for a weekend. While a job has less than 7 days of history, the model raises its upper bound toward four times the job's longest run. This extra margin shrinks to zero by day 7.

After training completes, the monitor can alert. The chart shows the observed values over time, with bounds above and below the line as a shaded area showing expected values. The color shows the current state:

Expand All @@ -32,6 +43,8 @@ After training completes, the monitor can alert. The chart shows the observed va
| Green | Normal | The observed value is within expected bounds. |
| Red | Alerting | The observed value fell outside expected bounds. |

<!-- SCREENSHOT: The monitor status page of a Row Count monitor that has finished training, with the chart's observed values, the shaded expected bounds, and a point outside the bounds in the alerting color. -->

## Alert state

When an anomaly is found, the model will remain in alert state for some time, until either the observed value returns to the original expected bounds or the anomaly has persisted long enough that the model considers it a new normal state. To resolve the monitor manually and return it to normal state, use [annotations][2].
Expand All @@ -48,13 +61,13 @@ Freshness monitors alert when the time since the last refresh is longer than exp

Row count monitors alert not only when there is an unusual change, but also when a row count flatlines, meaning it has not changed for longer than normal. A stalled row count may indicate a broken pipeline.

### Percentage (e.g. nullness, uniqueness)
### Percentage (such as nullness and uniqueness)

Percentage metrics are scaled from 0 to 100. If the metric has never been 0 or 100, a change to these values triggers an alert.

### Custom SQL

For Custom SQL monitors, select a model type for your metric: **Freshness**, **Percentage** or **Default**. The **Default** model infers the range from the metric's history. For example, if a custom metric has never returned a negative value, the model constrains the lower bound to 0.
For Custom SQL monitors, select a model type for your metric: {{< ui >}}Freshness{{< /ui >}}, {{< ui >}}Percentage{{< /ui >}}, or {{< ui >}}Default{{< /ui >}}. The {{< ui >}}Default{{< /ui >}} model infers the range from the metric's history. For example, if a custom metric has never returned a negative value, the model constrains the lower bound to 0.

## Seasonality

Expand Down Expand Up @@ -85,9 +98,46 @@ Annotations have two effects:

See [Annotate bounds][2] on the Data Observability Monitor page for available annotation types and how to apply them.

## Model configuration

{{< callout url="#" btn_hidden="true" header="Preview" >}}
Model configuration settings are in Preview.
{{< /callout >}}

The [model configuration settings][3] change how the model sets bounds:

- {{< ui >}}Sensitivity{{< /ui >}} sets a multiplier on the width of the bounds that the model computes from the metric's history. The default multiplier is `3`. Move the slider toward {{< ui >}}More alerts{{< /ui >}} to narrow the bounds, or toward {{< ui >}}Fewer alerts{{< /ui >}} to widen them.
- {{< ui >}}Minimum upper bound size{{< /ui >}} and {{< ui >}}Minimum lower bound size{{< /ui >}} set the smallest distance between the predicted value and each bound. The model can still set wider bounds. Enter values in the metric's own units, such as rows for Row Count or percentage points for Nullness. For integer metrics such as Row Count, the model rounds the value up to a whole number.
- {{< ui >}}Model Instructions{{< /ui >}} don't change the bounds. The AI reviewer reads them when a value falls outside the bounds. See [Model Instructions](#model-instructions).

{{< ui >}}Alert after N consecutive anomalies{{< /ui >}} also leaves the bounds unchanged. It sets how many flagged evaluations in a row the monitor needs before it alerts.

## AI review of flagged points

Monitors that use the {{< ui >}}Anomalies{{< /ui >}} detection method send each newly flagged point to an AI reviewer before they alert. A point is newly flagged when its value falls outside the expected bounds and the previous value didn't. This includes job duration monitors that use {{< ui >}}Anomalies{{< /ui >}}. Monitors that use the {{< ui >}}Thresholds{{< /ui >}} detection method don't use the reviewer.

The reviewer analyzes the metric's history. It compares the flagged value with earlier periods of normal behavior in the same context, such as the same hour or day of the week. The review has one of the following outcomes:

- If the reviewer finds earlier normal periods that match the flagged value's pattern and timing, it dismisses the point. The monitor widens the bounds at that point to include the observed value and doesn't alert.
- If the reviewer doesn't dismiss the point, the monitor alerts as usual. Later points in the same anomaly aren't reviewed again.
- If the review doesn't run or doesn't finish, the point keeps its original bounds and the monitor alerts as usual. For example, this happens when the monitor has reached its daily review limit or the review times out. The review also doesn't run for organizations whose settings don't allow AI model providers, such as HIPAA-enabled organizations.

The reviewer can only dismiss flagged points. It doesn't narrow the bounds or create alerts. To get alerts on values that fall within the bounds, adjust {{< ui >}}Sensitivity{{< /ui >}} or annotate the bounds with {{< ui >}}Missed alert{{< /ui >}}.

The reviewer dismisses a Row Count value of `0` only when the metric's history shows that zeros are routine. For example, the metric has dropped to zero and recovered several times before. This applies even when the monitor's {{< ui >}}Model Instructions{{< /ui >}} describe the value as expected.

### Model Instructions

{{< ui >}}Model Instructions{{< /ui >}}, one of the Preview [model configuration settings][3], give the reviewer plain-language context about behavior you expect, such as `Don't alert on large increases during US holidays`. The reviewer reads them only for flagged points:

- If the instructions describe the flagged point as expected, the reviewer dismisses it, even when the metric's history alone doesn't support a dismissal.
- Instructions that name specific tables, columns, or group values apply only to the series that match them.
- Instructions can cover every point, for example by asking not to alert on the monitor at all. The reviewer then treats every flagged point as expected.

## Further reading

{{< partial name="whats-next/whats-next.html" >}}

[1]: /monitors/types/data_observability/
[2]: /monitors/types/data_observability/#annotate-bounds
[3]: /monitors/types/data_observability/#model-configuration
2 changes: 1 addition & 1 deletion hugo/content/en/monitors/types/data_observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ For monitors using the {{< ui >}}Anomalies{{< /ui >}} detection method, expand t
| {{< ui >}}Minimum upper bound size{{< /ui >}} | The minimum distance between the predicted value and the upper bound, in the metric's units. Freshness uses seconds, and percentage metrics, such as Nullness, use percentage points. All other metrics use the metric's value, such as rows for Row Count, distinct values for Cardinality, or the returned value for Custom SQL. For example, a value of `1000` on a Row Count monitor keeps the upper bound at least 1,000 rows above the predicted value. A value of `3600` on a Freshness monitor keeps it at least one hour above. The model can still set a wider bound. |
| {{< ui >}}Minimum lower bound size{{< /ui >}} | The minimum distance between the predicted value and the lower bound, in the metric's own units. For example, a value of `1000` on a Row Count monitor keeps the lower bound at least 1,000 rows below the predicted value. The model can still set a wider bound. |
| {{< ui >}}Sensitivity{{< /ui >}} | Controls the width of the expected bounds, relative to the metric's normal variation. Move the slider toward {{< ui >}}Fewer alerts{{< /ui >}} for wider bounds, or toward {{< ui >}}More alerts{{< /ui >}} for narrower bounds. The slider sets a bound-width multiplier whose values roughly correspond to numbers of standard deviations. The default is `3`, and the range is `0.1` (narrowest bounds) to `6` (widest bounds). In the API, set this value with the `sensitivity` option. Configured minimum bound sizes still apply. |
| {{< ui >}}Model Instructions{{< /ui >}} | Provides plain-language context, up to 500 characters, about metric behavior you expect and don't want alerts for. For example: `Don't alert on large increases during US holidays`. |
| {{< ui >}}Model Instructions{{< /ui >}} | Provides plain-language context, up to 500 characters, about metric behavior you expect and don't want alerts for. For example: `Don't alert on large increases during US holidays`. An AI reviewer reads these instructions when a value falls outside the bounds. See [Model Instructions](/data_observability/quality_monitoring/guides/anomaly_detection/#model-instructions). |

Use the following guidelines to tune a monitor:

Expand Down
Loading