---
title: Anomaly Detection for Data Observability Monitors
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.
breadcrumbs: >-
  Docs > Data Observability Overview > Quality Monitoring > Guides > Anomaly
  Detection for Data Observability Monitors
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Anomaly Detection for Data Observability Monitors

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

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

## Overview{% #overview %}

By default, [Data Observability monitors](https://docs.datadoghq.com/monitors/types/data_observability.md) 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 moves outside those bounds, an AI reviewer checks the point. The monitor alerts unless the reviewer finds that the value matches the metric's normal behavior. For details, see the AI review of flagged points section.

## Training period{% #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 3 to 7 days for a monitor that runs more than once a day. A monitor that runs once a day typically trains for 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 continues training until the time since the last refresh reaches three times the maximum freshness observed before that update.
- **Row Count**: If the monitor would exit training on Monday but the row count is flat, the monitor stays in training until the count changes or Monday ends (UTC). This avoids false alerts for tables that do not update over the weekend.
- **Custom SQL (Default model type)**: 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 day of runs on any weekday (Monday through Friday), or more than 7 days of history. It doesn't wait for a weekend.

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:

| Color | State    | Description                                                         |
| ----- | -------- | ------------------------------------------------------------------- |
| Blue  | Training | The monitor is learning baseline behavior. No alerts are triggered. |
| Green | Normal   | The observed value is within expected bounds.                       |
| Red   | Alerting | The observed value fell outside expected bounds.                    |

{% image
   source="https://docs.dd-static.net/images/data_observability/anomaly_detection/training_normal_alerting_states.45431394ffc038f010cf4a6b2644ea05.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/data_observability/anomaly_detection/training_normal_alerting_states.45431394ffc038f010cf4a6b2644ea05.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="Monitor chart with training in blue, values inside the shaded bounds in green, and a drop below the bounds in red." /%}

## Alert state{% #alert-state %}

When an anomaly is found, the model remains in alert state 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](https://docs.datadoghq.com/monitors/types/data_observability.md#annotate-bounds).

## Metric-specific behavior{% #metric-specific-behavior %}

The model works differently for different metrics:

### Freshness{% #freshness %}

Freshness monitors alert when the time since the last refresh is longer than expected based on historical update patterns. The model adds a small buffer to the upper bound to avoid alerting on minor delays.

### Row count{% #row-count %}

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 (such as nullness and 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{% #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.

## Seasonality{% #seasonality %}

The model adjusts for seasonal patterns, trends, and past annotations. For example, if a metric consistently drops on Sundays, the model treats lower values on Sundays as normal rather than anomalous.

The model detects the following seasonal patterns. The amount of history it uses depends on the pattern:

| Pattern      | Description                                                                              | History used            |
| ------------ | ---------------------------------------------------------------------------------------- | ----------------------- |
| Hour of day  | Metrics that follow intraday patterns, such as higher row counts during business hours.  | About the last month    |
| Hour of week | Metrics with consistent patterns across a full week at hourly granularity.               | About the last 3 months |
| Day of week  | Metrics that differ across days of the week, such as lower activity on Sundays.          | About the last 3 months |
| Day of month | Metrics with recurring patterns tied to the calendar month, such as end-of-month spikes. | Up to 400 days          |

Not all seasonal patterns are available for all metric types. The model requires at least two complete cycles of normal history to detect a pattern, and typically detects it after three or more cycles. For example, a weekly pattern needs at least two weeks of history, and the model usually detects it after three weeks.

## Trends{% #trends %}

The model accounts for whether a metric is growing or shrinking over time. For a metric that consistently adds rows each week, the model adjusts expectations based on the direction and rate of change rather than treating growth as anomalous.

## Annotations{% #annotations %}

Annotations let you immediately retrain the model when it misclassifies a point, either by missing an alert or by generating a false alert. Because data quality expectations are often metric-specific, annotations are the primary way to tune the model to your team's needs.

Annotations have two effects:

- **Correcting the current state**: Marking a flagged point as expected moves the monitor out of the alerting state to normal state at the next observation, so it can then alert on new anomalies.
- **Shaping future predictions**: The model uses annotated points to adjust future bounds, so feedback immediately improves accuracy.

See [Annotate bounds](https://docs.datadoghq.com/monitors/types/data_observability.md#annotate-bounds) on the Data Observability Monitor page for available annotation types and how to apply them.

## Model configuration{% #model-configuration %}

The [model configuration settings](https://docs.datadoghq.com/monitors/types/data_observability.md#model-configuration) change how the model sets bounds:

- Sensitivity adjusts the width of the bounds that the model computes. The default value is `3`, and the range is `0.1` to `6`. Move the slider toward More alerts to narrow the bounds, or toward Fewer alerts to widen them.
- Minimum upper bound size and Minimum lower bound size 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, percentage points for Nullness, or nanoseconds for Job duration. For integer metrics such as Row Count, the model rounds the value up to a whole number.
- Model Instructions inform the AI reviewer, which reads them when a value falls outside the bounds. See the Model Instructions section.
- Alert after N consecutive anomalies sets how many flagged points in a row the monitor needs before it alerts.

## AI review of flagged points{% #ai-review-of-flagged-points %}

Monitors that use the Anomalies detection method send each newly flagged point to an AI reviewer before they alert.

The reviewer reanalyzes the metric's history. It compares the flagged value with earlier 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 periods that match the flagged value's pattern and timing, it dismisses the point, and the monitor doesn't alert. The monitor widens the bounds at that point to include the observed value.
- If the reviewer doesn't dismiss the point, the monitor alerts as usual. The reviewer doesn't review later points in the same anomaly.

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 Sensitivity or annotate the bounds with Missed alert.

### Model Instructions{% #model-instructions %}

Model Instructions, one of the [model configuration settings](https://docs.datadoghq.com/monitors/types/data_observability.md#model-configuration), 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.

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Quality Monitoring](https://docs.datadoghq.com/data_observability/quality_monitoring.md)
- [Data Observability Monitor](https://docs.datadoghq.com/monitors/types/data_observability.md)
