---
title: Data Observability Monitor
description: >-
  Monitor freshness, row count, column-level metrics, and custom SQL queries
  across your data warehouses, as well as failed or long-running data jobs.
breadcrumbs: Docs > Monitors > Monitor Types > Data Observability Monitor
---

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

# Data Observability Monitor

{% 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 %}

## Overview{% #overview %}

[Data Observability](https://docs.datadoghq.com/data_observability.md) monitors use anomaly detection that learns from seasonality, trends, and user feedback to catch delayed data, incomplete loads, and unexpected value changes before they affect downstream dashboards, AI applications, or business decisions. Combined with end-to-end data and code lineage, these monitors help teams detect issues early, assess downstream impact, and route to the right owner.

Data Observability also includes job monitors, which alert when data jobs such as Airflow DAGs, Databricks jobs, or dbt models fail or run longer than expected.

Data quality monitors support the following metric types:

**Table-level metric types:**

| Metric type | Description                                             |
| ----------- | ------------------------------------------------------- |
| Freshness   | Tracks the time elapsed since a table was last updated. |
| Row Count   | Tracks the number of rows in a table or view.           |
| Custom SQL  | Tracks a custom metric value returned by a SQL query.   |

**Column-level metric types:**

| Metric type                                 | Description                                            |
| ------------------------------------------- | ------------------------------------------------------ |
| Freshness                                   | Tracks the most recent date seen in a datetime column. |
| Uniqueness                                  | Tracks the percentage of unique values.                |
| Nullness                                    | Tracks the percentage of null values.                  |
| Cardinality                                 | Tracks the number of distinct values.                  |
| Percent Zero                                | Tracks the percentage of values equal to zero.         |
| Percent Negative                            | Tracks the percentage of negative values.              |
| Min / Max / Mean / Sum / Standard Deviation | Tracks statistical measures across column values.      |

Datadog collects metrics such as row count and freshness from warehouse system metadata (for example, `INFORMATION_SCHEMA`) when available. This avoids running a query against your warehouse and reduces compute costs. Not all warehouses expose system metadata. For metrics that cannot be collected from system metadata, the monitor runs a query directly against your warehouse to compute the value.

Data quality, source to target, and schema change monitors require [Quality Monitoring](https://docs.datadoghq.com/data_observability/quality_monitoring.md) to be set up with at least one supported data warehouse (for example, [Snowflake](https://docs.datadoghq.com/data_observability/quality_monitoring/data_warehouses/snowflake.md), [Databricks](https://docs.datadoghq.com/data_observability/quality_monitoring/data_warehouses/databricks.md), or [BigQuery](https://docs.datadoghq.com/data_observability/quality_monitoring/data_warehouses/bigquery.md)). Job monitors require [Jobs Monitoring](https://docs.datadoghq.com/data_observability/jobs_monitoring.md) to be set up for at least one supported technology.

Data Observability offers four monitor types, selected in the first step of the [monitor creation flow](https://app.datadoghq.com/monitors/create/data-quality):

| Monitor type     | What it monitors                                                             |
| ---------------- | ---------------------------------------------------------------------------- |
| Data quality     | Freshness, row count, and column-level metrics on tables and columns.        |
| Source to target | The difference in the same metric between a source asset and a target asset. |
| Schema change    | Fields added, removed, renamed, or retyped in your warehouse.                |
| Job              | Failed job runs and job runs that take too long.                             |

Unless stated otherwise, the following sections describe the data quality monitor type.

## Monitor creation{% #monitor-creation %}

To create a Data Observability monitor in Datadog, navigate to [Data Observability > Monitors > New Monitor](https://app.datadoghq.com/monitors/create/data-quality) or [Monitors > New Monitor > Data Observability](https://app.datadoghq.com/monitors/create/data-quality). To view all existing Data Observability monitors, see the [Data Observability Monitors page](https://app.datadoghq.com/data-obs/monitors).

## Choose data to monitor{% #choose-data-to-monitor %}

First, select whether to monitor the Table or Column level:

{% image
   source="https://docs.dd-static.net/images/monitors/monitor_types/data_observability/entity_type_selection_and_aastra.9d03b241f22cfc4058a091c594a08a02.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/monitor_types/data_observability/entity_type_selection_and_aastra.9d03b241f22cfc4058a091c594a08a02.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="Choose data to monitor: entity type selector, query input, and lineage relationship filter" /%}

Then, use the Edit tab to search for tables, views, or columns by typing `key:value` filters into the search field.

**Filter by name or location:**

| Filter   | Example                 | Description                            |
| -------- | ----------------------- | -------------------------------------- |
| Name     | `name:USERS*`           | Match by name. Supports `*` wildcards. |
| Schema   | `schema:PROD`           | Match by schema.                       |
| Database | `database:ANALYTICS_DB` | Match by database.                     |
| Account  | `account:my_account`    | Match by account.                      |

**Filter by tag:**

Filter on any tag applied to your data assets by using the tag key as the filter key. For example, if your assets are tagged with `owner`, `platform`, or `environment`, search on those tags directly:

| Example                    | Description                                          |
| -------------------------- | ---------------------------------------------------- |
| `owner:data-platform-team` | Match assets tagged with `owner:data-platform-team`. |
| `platform:snowflake`       | Match assets tagged with `platform:snowflake`.       |
| `environment:production`   | Match assets tagged with `environment:production`.   |

Tag filters support the same `*` wildcards and quoting as name filters, for example, `owner:data-*` or `platform:"Snowflake Prod"`.

**Filter by computed attribute:**

In addition to your own tags, Datadog computes attributes for your data assets that you can filter on. The available computed attribute is:

| Attribute       | Values                                                    | Description                                                                                                                                                                                                                                                       |
| --------------- | --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `lineage_score` | `0.00`, `0.10`, `0.30`, `0.50`, `0.70`, `0.90`, or `1.00` | A relative measure of how connected an asset is in your lineage graph, based on how many downstream assets depend on it compared to other assets of the same type. Higher values identify the tables, views, and columns that the downstream consumers depend on. |

`lineage_score` is bucketed into the discrete tiers listed above rather than taking a continuous value, so filter on one of those exact values. Match a single tier, or combine tiers with `OR`. For example, `lineage_score:1.00` returns your most depended-on assets, and `lineage_score:(0.90 OR 1.00)` returns the top two tiers.

Combine any of these filters with `AND` or `OR`, use parentheses to group conditions, and prefix with `-` to exclude.

Filter values are not case-sensitive. For example, `name:users*` and `name:USERS*` match the same tables.

**Examples:**

| Goal                                                                 | Query                                                       |
| -------------------------------------------------------------------- | ----------------------------------------------------------- |
| All tables in the PROD schema, excluding temp tables                 | `schema:PROD AND -name:TEMP*`                               |
| All tables in the PROD schema except one table                       | `schema:PROD AND -name:ORDERS_BACKUP`                       |
| All tables in the PROD schema except tables tagged `monitoring:skip` | `schema:PROD AND -monitoring:skip`                          |
| All timestamp columns                                                | `name:*_AT OR name:*_TIMESTAMP`                             |
| Tables in either PROD or STAGING for a specific database             | `database:ANALYTICS_DB AND (schema:PROD OR schema:STAGING)` |
| Tables owned by a specific team                                      | `owner:data-platform-team`                                  |
| The most depended-on tables in a database                            | `database:ANALYTICS_DB AND lineage_score:1.00`              |

**Filter by lineage relationship:**

To scope your selection to assets that are connected to another asset in your lineage graph, click Add Relation Filter. Choose Upstream of or Downstream of, then select a specific asset or use the same `key:value` filters to match a set of assets. For example, monitor every table that is upstream of a critical dashboard, or every column downstream of a specific source table.

**Filter by hierarchy relationship:**

To scope your selection to assets that are a parent or child of another asset in your lineage graph, click Add Relation Filter. Choose Parent of or Child of, then select a specific asset or use the same `key:value` filters to match a set of assets. For example, monitor every table that has a `revenue` column, or every table that is within a critical schema.

A single monitor can track up to 5,000 tables, views, or columns. This limit cannot be increased. If your query matches more, split them across multiple monitors.

The monitor also covers assets created in the future that match the query. If no assets match, it does not evaluate anything until a matched asset is created.

## Select your metric type{% #select-your-metric-type %}

Choose a metric type based on the data quality signal you want to track. Each monitor tracks one metric type.

{% tab title="Freshness" %}
The Freshness metric type detects when data has not been updated within an expected time window. Use it to catch stale data before it affects downstream reports or models.

- **Table freshness** tracks the time elapsed since the table was last updated, using the data warehouse's definition of an update. For example, Snowflake uses `LAST_ALTERED`, and Databricks uses the latest commit in the table history. Table freshness is not available for views or for data warehouses that do not provide updated timestamps for tables in system metadata. Use column-level freshness instead.
- **Column freshness** tracks the most recent date seen in a datetime column.

{% /tab %}

{% tab title="Row Count" %}
The Row Count metric type tracks row count changes in your tables. Use it to detect unexpected drops or spikes in data that could indicate pipeline failures or upstream issues.
{% /tab %}

{% tab title="Column Metric" %}
Column metric types track column-level metrics to detect data drift or quality degradation. Select from the following:

| Metric             | Description                                                  |
| ------------------ | ------------------------------------------------------------ |
| Uniqueness         | The percentage of values in a column that are unique.        |
| Nullness           | The percentage of values in a column that are null.          |
| Cardinality        | The number of distinct values in a column.                   |
| Percent Zero       | The percentage of values in a column that are equal to zero. |
| Percent Negative   | The percentage of values in a column that are negative.      |
| Min                | The minimum of all values in a column.                       |
| Max                | The maximum of all values in a column.                       |
| Mean               | The average of all values in a column.                       |
| Standard Deviation | The measure of variation within values in a column.          |
| Sum                | The sum of all values in a column.                           |

{% alert level="info" %}
Some column metrics are only available for specific column types. Numeric metrics (Percent Zero, Percent Negative, Min, Max, Mean, Standard Deviation, Sum) require numeric columns.
{% /alert %}

{% /tab %}

{% tab title="Custom SQL" %}
The Custom SQL metric type tracks a custom metric value returned by a SQL query that you define. Use it when built-in metric types do not cover your use case, such as monitoring business-specific data quality rules.

1. Select a model type that describes the value returned by your query:
   - Default: The query returns a scalar value. Use this in most cases.
   - Freshness: The query returns the difference (in seconds) between the current time and the last time an event occurred.
   - Percentage: The query returns a percentage value between 0 and 100.
1. Write a SQL query that returns a numeric value, for example: `SELECT COUNT(*) as dd_value FROM ANALYTICS_DB.PROD.ORDERS WHERE STATUS = 'FAILED'`. If the query returns multiple columns, alias the value column as `dd_value`.
1. Click Validate. For data warehouses, Datadog runs the query against your warehouse and checks the result. For databases that connect through the Datadog Agent, such as [PostgreSQL](https://docs.datadoghq.com/data_observability/quality_monitoring/transactional_databases/postgres.md), Datadog checks the query's syntax without running it.

To track a value for each group, return group columns alongside `dd_value`, for example with a `GROUP BY` clause. Each returned row is evaluated as a separate group. When validation runs the query and returns rows, Datadog detects the group columns. For databases that connect through the Datadog Agent, or if Datadog doesn't detect the group columns, enter them in the Group by field, separated by commas (for example, `column_a, column_b`).

When validation runs the query against a data warehouse, it can report the following errors:

| Error                                                 | Cause                                                                                                |
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `The query must alias its result as "dd_value"`       | The query returns more than one column without a recognized value column.                            |
| `The query result must be numeric`                    | The value column contains a value that can't be read as a number.                                    |
| `No rows were returned`                               | The query returned no rows.                                                                          |
| `Custom SQL monitors can't group by timestamp values` | A group column contains timestamp values.                                                            |
| `More groups were returned than are allowed`          | The query returned more groups than the group limit allows. For the limit, see the Group by section. |

{% alert level="warning" %}
Datadog stores the `dd_value` result and the value of each grouped column. Avoid grouping by columns that contain sensitive data. For details, see [Data sent to Datadog](https://docs.datadoghq.com/data_observability/quality_monitoring.md#data-sent-to-datadog).
{% /alert %}

**Note**: Each Custom SQL monitor counts as an individual monitored table for billing purposes.

{% image
   source="https://docs.dd-static.net/images/monitors/monitor_types/data_observability/custom_sql_example.def9e4decd735a9f1f69cf086eedf358.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/monitor_types/data_observability/custom_sql_example.def9e4decd735a9f1f69cf086eedf358.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="Input field for custom SQL monitor creation." /%}

{% /tab %}

## Configure monitor{% #configure-monitor %}

### Detection method{% #detection-method %}

Select a detection method:

- Anomalies: Alert when the metric deviates from an expected pattern. Threshold values are not required. Before it can alert, the anomaly model trains, typically for 3 to 7 days for a monitor that runs more than once a day, or 9 days for a monitor that runs once a day. Some metrics, such as Freshness and Job duration, follow different rules. See [Training period in the Anomaly Detection guide](https://docs.datadoghq.com/data_observability/quality_monitoring/guides/anomaly_detection.md#training-period). During training, the monitor does not trigger alerts and is visualized in blue. After training completes, the monitor is shown in green when in a normal state and red when in an outlier state.
- Thresholds: Alert when the metric crosses a fixed value. Set the comparison operator (more than, more than or equal to, less than, less than or equal to, equal to, or not equal to) and define an Alert threshold (required) and optionally a Warning threshold. For more details, see [Configure Monitors](https://docs.datadoghq.com/monitors/configuration.md?tab=thresholdalert#thresholds).

### WHERE clause{% #where-clause %}

Add a WHERE clause to filter the data evaluated by the monitor. This is useful for monitoring specific segments of data or only recent records. For example:

- `created_at >= DATEADD(day, -7, CURRENT_TIMESTAMP())`: Monitor only rows from the past week.
- `region = 'US'`: Monitor only data for a specific region.

### Group by{% #group-by %}

You can add a Group by clause to split a single monitor into multiple groups, each evaluated independently. For example, grouping a row count monitor by a `REGION` column produces a separate alert for each geography.

{% image
   source="https://docs.dd-static.net/images/monitors/monitor_types/data_observability/group_by_column_selection.19e6abc4c77a12ec85d2e2689e658574.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/monitor_types/data_observability/group_by_column_selection.19e6abc4c77a12ec85d2e2689e658574.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="Input field for selecting GROUP BY dimensions." /%}

The limit is 500 groups per monitor.

### Missing data{% #missing-data %}

In the If data is missing to evaluate dropdown menu, select what the monitor reports when no data is available for an evaluation.

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

For monitors using the Anomalies detection method, expand the collapsed Model configuration section to refine how the model behaves. Model configuration is part of the monitor definition, so to change it on an existing monitor, edit the monitor. Model configuration is separate from bound annotations, which you add from the monitor's status page. See the Annotate bounds section.

| Setting                             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Alert direction                     | Whether the monitor alerts above the upper bound, below the lower bound, or both. The default is Above or below.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Alert after N consecutive anomalies | The number of consecutive failed evaluations before the monitor alerts. Configure this setting to suppress isolated spikes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Minimum upper bound size            | The minimum distance between the predicted value and the upper bound, in the metric's units. Freshness uses seconds, Job duration uses nanoseconds, 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, and a value of `60000000000` on a Job duration monitor keeps it at least one minute above. The model can still set a wider bound. |
| Minimum lower bound size            | The minimum distance between the predicted value and the lower bound, in the same units as Minimum upper bound size. 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. For Freshness monitors, this setting does not control the lower bound.                                                                                                                                                                                                                                                                                                                                             |
| Sensitivity                         | Controls the width of the expected bounds, relative to the metric's normal variation. Move the slider toward Fewer alerts for wider bounds, or toward More alerts 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.                                                                                                                                                                                                            |
| Model Instructions                  | 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 in the Anomaly Detection guide](https://docs.datadoghq.com/data_observability/quality_monitoring/guides/anomaly_detection.md#model-instructions).                                                                                                                                                                                                                                                             |

Use the following guidelines to tune a monitor:

- To get more or fewer alerts across the whole series, adjust Sensitivity. Bounds scale with how much the metric normally varies.
- To avoid alerts on deviations smaller than a fixed amount, such as fewer than 1,000 rows from the predicted value, set a minimum bound size.
- To correct how the model handled specific points, such as a missed alert or a false alert, annotate the bounds. See the Annotate bounds section.
- To alert on only one side of the expected bounds, select an Alert direction. For monitors defined with the [Monitors API](https://docs.datadoghq.com/api/latest/monitors.md) or Terraform, set `model_bounds_override` in `monitor_options.model_configuration` to `UPPER_ONLY` or `LOWER_ONLY`. Leave it unset to alert on both sides.

### Monitor schedule{% #monitor-schedule %}

Set how often the monitor evaluates your data:

- Scheduled: The monitor runs on a fixed cadence. Under Run this monitor, select Default schedule, Hourly, Every 3 hours, Every 6 hours, Every 12 hours, Daily, or Custom schedule.
- Manual (Preview): The monitor runs only when triggered programmatically with the [Data Observability API](https://docs.datadoghq.com/api/latest/data-observability.md). To build history for anomaly detection, trigger it on a schedule.
  - In the UI, use a Custom SQL or column-level metric. Row Count and Freshness are not supported.
  - Manual monitors don't run on databases that connect through the Datadog Agent, such as [PostgreSQL](https://docs.datadoghq.com/data_observability/quality_monitoring/transactional_databases/postgres.md).
  - A new monitor shows no values until its first run. Changes to your data appear after the next run.

Default schedule is selected for new data quality monitors. It follows the metric collection cadence for the selected assets, typically every hour, and the option shows the resulting cadence. Source to target monitors don't offer Default schedule and start with Hourly.

To define your own cadence, select Custom schedule and enter a cron expression in the Cron tab field. Cron expressions are evaluated in UTC. A custom schedule can run as often as every 15 minutes. Next 3 Runs lists the upcoming runs in your Datadog time zone, so you can confirm the expression before saving it.

For the preset intervals, Starting from sets the time of day of the runs in your Datadog time zone. Datadog converts that time to UTC with your time zone's current offset. Schedules are saved in UTC and don't adjust for daylight saving time. If your time zone observes daylight saving time, the local time of each run shifts by one hour when the clocks change.

If you edit a monitor and switch it between Scheduled and Manual, the monitor stops showing values from the previous schedule after you save. Datadog keeps those values and shows them again if you switch back.

### Set alert conditions{% #set-alert-conditions %}

Choose an aggregation type:

- Simple Alert: Send a single notification when any monitored table or column meets the condition.
- Multi Alert: Send a notification for each group meeting the condition. Customize which dimensions to group by (for example, `table`, `schema`, `database`) to control alert granularity. For example, grouping by `schema` only sends one alert per schema, bundling all affected tables together to reduce noise.

### Example notification{% #example-notification %}

{% tab title="Threshold" %}

```text
{{#is_alert}}
Data quality issue detected on {{database.name}}.{{schema.name}}.{{table.name}}:
current value {{value}} has breached the threshold of {{threshold}}.
{{/is_alert}}

{{#is_recovery}}
Data quality issue on {{database.name}}.{{schema.name}}.{{table.name}} has recovered.
Current value {{value}} is within the threshold of {{threshold}}.
{{/is_recovery}}
```

{% /tab %}

{% tab title="Anomaly" %}

```text
{{#is_alert}}
Anomaly detected on {{database.name}}.{{schema.name}}.{{table.name}}:
observed value {{observed}} is outside the expected range of {{lower_bound}} to {{upper_bound}}
(predicted: {{predicted}}).
{{/is_alert}}

{{#is_recovery}}
{{database.name}}.{{schema.name}}.{{table.name}} has recovered.
Observed value {{observed}} is within the expected range.
{{/is_recovery}}
```

{% /tab %}

## Source to target monitors{% #source-to-target-monitors %}

A source to target monitor compares the same metric on two data assets and alerts when the two values diverge. Other Data Observability monitors track whether a single asset is fresh or complete. A source to target monitor tracks whether the copy that landed in a destination matches what left the source.

When a pipeline moves data between systems, partial failures rarely look like failures. If 100,000 rows leave a source table and 99,850 rows arrive in the destination, a row count monitor on the destination alone sees a plausible value. Comparing the two assets surfaces the gap.

Use a source to target monitor to:

- Validate replication from Postgres into Databricks.
- Reconcile two databases inside the same Snowflake account, for example a quality database against production.
- Verify a migration from Redshift to BigQuery before cutover, by running both systems side by side and confirming that they match.
- Confirm that a transformation does not drop rows between its input and its output.

Source to target monitors are available in all regions except GovCloud.

### Create a source to target monitor{% #create-a-source-to-target-monitor %}

1. Navigate to [Monitors > New Monitor](https://app.datadoghq.com/monitors/create/data-quality) and select Source to Target.
1. Under Define the pair, set Compare at to Table level or Column level.
1. Under Source, select the data source and the asset to compare.
1. Under Target, select the data source and the asset to monitor. The source and target can be in different data sources or the same one.
1. Under Select your metric type, choose the metric to compare. Source to target monitors support the same metric types as other Data Observability monitors, including row count, freshness, nullness, uniqueness, cardinality, and Custom SQL.
1. Set Format to control how the comparison is expressed:
   - Difference: the target value minus the source value. A negative value means the target has less than the source.
   - Percent Difference: the same difference as a percentage of the source value.
1. Configure the detection method, schedule, and notifications as described in Configure monitor.

The source and the target each have their own optional WHERE clause under Filter & group. If you filter by date, use the same date filter on both sides so that the two values cover the same period.

The Preview Monitor Evaluation panel shows the identified source and target, along with a preview of the selected metric.

The monitored asset is the target, so the monitor appears on the target's status page.

### Compare a custom metric{% #compare-a-custom-metric %}

When the metric type is Custom SQL, supply one query for the source and one query for the target. Each query runs in the warehouse of the asset that you selected for that side. A query can read from more than one table, for example with a join. Each query must return a numeric value. If a query returns multiple columns, alias the value column as `dd_value`, as described in the Custom SQL tab of the Select your metric type section. Both queries must return the same shape, such as one row with one numeric column.

A WHERE clause is not accepted for this metric type. Include any filtering in each query, and apply the same date filter in both queries.

### Evaluation{% #evaluation %}

The difference between the source and the target is recorded as its own metric, so a source to target monitor is evaluated by the same detection methods as any other Data Observability monitor, including anomaly detection. Both sides are measured on the monitor's schedule rather than following each warehouse's default collection cadence.

The Anomalies detection method learns the usual difference between the source and the target from the monitor's history. A difference that already exists when you create the monitor becomes part of the expected range, so the monitor does not alert on it. To require the two sides to match, select Thresholds, set the comparison to not equal to, and set the Alert threshold to `0`.

## Schema change monitors{% #schema-change-monitors %}

A schema change monitor alerts when the structure of your data changes, rather than when its contents change. Use it to catch an upstream change before it breaks a downstream pipeline or dashboard. For example, the monitor can alert on a dropped column, a renamed table, or a column that switches to a different data type.

Schema change monitors detect four kinds of change across databases, schemas, tables, and columns:

| Change type  | `change_type` value | Description                                                                                                                                                                                                                                                                                 |
| ------------ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Added        | `added`             | A schema, table, or column was created. New databases are not reported as added.                                                                                                                                                                                                            |
| Removed      | `removed`           | A database, schema, table, or column was dropped. When a database, schema, or table is dropped, each object inside it is also reported as removed.                                                                                                                                          |
| Renamed      | `renamed`           | A table was renamed. Datadog detects a rename when a new table with the same columns and data types replaces the old table in the same schema. Otherwise, the rename appears as one removed table and one added table. A renamed column appears as one removed column and one added column. |
| Type changed | `type_changed`      | A column's data type changed, such as from `INTEGER` to `STRING`, or a table's type changed, such as from a table to a view.                                                                                                                                                                |

Schema changes are detected for Snowflake, BigQuery, Databricks, Redshift, and ClickHouse Cloud. Data Observability for [ClickHouse Cloud](https://docs.datadoghq.com/data_observability/quality_monitoring/data_warehouses/clickhouse.md) is in Preview.

### Create a schema change monitor{% #create-a-schema-change-monitor %}

1. Navigate to [Monitors > New Monitor > Schema Change](https://app.datadoghq.com/monitors/create/schema-change).
1. Under Warehouse, select the warehouse to watch.
1. Under Watch at, select the schema, table, or column level.
1. Optionally, enter a search to limit the changes that the monitor alerts on. See the Filter schema changes section.
1. Choose whether to watch all matching assets or only the assets you select.
1. Configure notifications as described in Configure monitor.

A schema change monitor does not take a metric type or a detection method because it alerts on a structural change rather than on a measured value crossing a bound.

### Filter schema changes{% #filter-schema-changes %}

The schema change search accepts the following fields:

| Field         | Matches                                                               |
| ------------- | --------------------------------------------------------------------- |
| `database`    | The name of the database.                                             |
| `schema`      | The name of the schema.                                               |
| `table`       | The name of the table.                                                |
| `column`      | The name of the column.                                               |
| `change_type` | The kind of change: `added`, `removed`, `renamed`, or `type_changed`. |

The available fields depend on the selected level. For example, `column` is available at the column level, and `table` is available at the table and column levels. To choose the level of change to watch, use the Watch at setting.

Combine fields with `AND` or `OR`, and prefix a term with `-` to exclude changes that match it. To match by name, use the `table` or `column` field. Use `*` as a wildcard, for example `table:orders*`.

{% alert level="warning" %}
A search with invalid syntax, an unsupported field, or text without a field name matches no changes, so the monitor never alerts.
{% /alert %}

To alert on a single kind of change, filter on `change_type`. For example:

| Goal                                                       | Search                |
| ---------------------------------------------------------- | --------------------- |
| Alert only when an object is removed                       | `change_type:removed` |
| Alert on changes to tables whose names start with `orders` | `table:orders*`       |
| Alert on every change except additions                     | `-change_type:added`  |

### Browse detected schema changes{% #browse-detected-schema-changes %}

To see the changes Datadog has detected without creating a monitor, go to [Data Observability > Schema Changes](https://app.datadoghq.com/data-obs/schema-changes). Filter by platform, account, database, schema, or change type, and expand an entry to see the affected columns and their data types.

Changes are detected when Datadog next collects schema metadata from your warehouse and compares the current structure against the previously collected one.

## Job monitors{% #job-monitors %}

A job monitor evaluates every run of the jobs you select, and alerts when a run fails or takes too long. Job monitors require [Jobs Monitoring](https://docs.datadoghq.com/data_observability/jobs_monitoring.md) to be set up for at least one supported technology.

Job monitors support two checks:

| Check        | Alerts when                                                                                                 |
| ------------ | ----------------------------------------------------------------------------------------------------------- |
| Job failure  | A set number of consecutive runs of a job fail.                                                             |
| Job duration | A run takes longer than a fixed threshold, or longer than normal when using the Anomalies detection method. |

You can add both checks in one monitor definition. Datadog then creates two monitors, one for failures and one for duration, that share the same jobs and notification settings.

### Create a job monitor{% #create-a-job-monitor %}

1. Navigate to the [job monitor creation page](https://app.datadoghq.com/data-obs/monitors/create/data-jobs).

1. Under Select jobs, choose the jobs to monitor:

   - In Technology, select the kind of job. You cannot change the technology after you create the monitor.
   - In Filter to jobs, search for jobs by name, or filter with `key:value` tags or attributes to match a set of jobs.
   - In Filter runs, filter monitored runs by tags or attributes that change per run of the same job. This option is available only for Airflow DAGs and tasks, Databricks jobs, and custom OpenLineage jobs.

   {% image
      source="https://docs.dd-static.net/images/monitors/monitor_types/data_observability/job_monitor_select_jobs.6d1bfba125aaf89cba23e2ae1f62db8b.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/monitor_types/data_observability/job_monitor_select_jobs.6d1bfba125aaf89cba23e2ae1f62db8b.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="The Select jobs step with DAG selected as the technology, a name filter applied, and two matching jobs listed." /%}

1. Under Add checks, select Job failure, Job duration, or both. Configure each check as described in Job failure and Job duration.

1. Under Notify & schedule, enter a monitor name and a message. Job failure alerts already include the job name, the failure count, the error, and links to the job and the failed run. Use the message for routing, @-mentions, and team context.

1. Under Permissions, optionally restrict who can edit the monitor.

1. Review the monitor settings and create the monitor.

### Group by for job monitors{% #group-by-for-job-monitors %}

Each check is grouped by the attributes that identify a job in the selected technology, so each job alerts separately. The following table lists the required Group by tags for each technology. You can add tags to alert separately on different runs of the same job, but you cannot remove the required tags:

| Technology                                                                                         | Job types                                     | Required group by                           |
| -------------------------------------------------------------------------------------------------- | --------------------------------------------- | ------------------------------------------- |
| Airflow                                                                                            | DAG                                           | `name`, `env`                               |
| Airflow                                                                                            | Task                                          | `name`, `dag_name`, `env`                   |
| AWS Glue                                                                                           | Job                                           | `name`, `env`, `account`, `region`          |
| Azure Data Factory                                                                                 | Pipeline                                      | `name`, `tenant`, `subscription`, `factory` |
| Databricks                                                                                         | Job                                           | `job_name`, `workspace_name`                |
| dbt                                                                                                | Job, Model, Test                              | `name`, `project`, `env`                    |
| Spark                                                                                              | Batch Job                                     | `job_name`, `env`                           |
| [Custom OpenLineage](https://docs.datadoghq.com/data_observability/jobs_monitoring/openlineage.md) | Each job that sends custom OpenLineage events | `integration`, `name`, `env`                |

### Job failure{% #job-failure %}

The Job failure check alerts when consecutive runs of a job fail.

1. Set Trigger when to the number of consecutive failed runs that triggers an alert. For example, enter `1` to alert after any failure and `2` to alert only after two failed runs in a row.
1. Optionally, set Warn when to a lower count.

The monitor recovers automatically when a later run succeeds.

{% image
   source="https://docs.dd-static.net/images/monitors/monitor_types/data_observability/job_monitor_failure.6e69baeaf944a3b2bc836c22721ae387.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/monitor_types/data_observability/job_monitor_failure.6e69baeaf944a3b2bc836c22721ae387.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="A Job failure check with alert and warning thresholds for consecutive failed runs and a graph of failed runs." /%}

### Job duration{% #job-duration %}

The Job duration check alerts when a run takes too long. For some technologies, the check also evaluates runs that are still in progress, so an alert can fire before the run finishes. See the How job duration is evaluated section. Use the check to catch stuck or late pipelines, even if a run eventually succeeds.

Choose a Detection method:

{% tab title="Anomalies" %}
Anomalies is the default and recommended method because it reduces false positives and the configuration overhead of these monitors. The monitor learns how long each job usually takes from its recent successful runs, and alerts when a run takes unusually long for that job. You don't set a threshold, so this method suits a monitor that covers many jobs with different run times.

- Each job starts in a training period and isn't evaluated until it has at least five completed runs over at least 1 day. It also needs runs covering one full weekday (any day from Monday through Friday), or more than 7 days of history. Job duration monitors don't wait for a weekend. See the [Training period](https://docs.datadoghq.com/data_observability/quality_monitoring/guides/anomaly_detection.md#training-period) section of the Anomaly Detection for Data Observability Monitors guide.

- To give the model feedback on its bounds, see Annotate bounds.

  {% image
     source="https://docs.dd-static.net/images/monitors/monitor_types/data_observability/job_monitor_duration_anomalies.1fc271e2991186d82870526a52215a90.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/monitor_types/data_observability/job_monitor_duration_anomalies.1fc271e2991186d82870526a52215a90.png?auto=format&fit=max&w=850&dpr=2 2x"
     alt="A Job duration check using the Anomalies detection method, with a graph of recent run durations." /%}

{% /tab %}

{% tab title="Thresholds" %}
The Thresholds method alerts when a run crosses a fixed duration.

1. Under Alert threshold, set Trigger when a run exceeds to a duration in minutes or hours.
1. Optionally, set Warning threshold to a shorter duration. The warning threshold must be less than the alert threshold.

One threshold applies to every job that the monitor matches. If the selected jobs have different typical run times, create a monitor for each group of similar jobs, or use Anomalies.

{% image
   source="https://docs.dd-static.net/images/monitors/monitor_types/data_observability/job_monitor_duration_thresholds.1c24d16ef7189e2cf38ee0705b1def0d.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/monitor_types/data_observability/job_monitor_duration_thresholds.1c24d16ef7189e2cf38ee0705b1def0d.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="A Job duration check using the Thresholds detection method, with alert and warning thresholds shown on the run duration graph." /%}

{% /tab %}

The preview graph shows the durations of recent completed runs for the selected jobs. Use it to compare a threshold against real run times before you save the monitor.

#### How Job duration is evaluated{% #how-job-duration-is-evaluated %}

- **Runs in progress**: The monitor can evaluate a run after the job platform reports that it has started. It compares the elapsed time against the threshold or learned bound. If an alert fires during a run, the monitor's status page shows how long the run has been in progress. The following jobs can be evaluated while they run:
  - Airflow DAGs and non-deferrable tasks
  - AWS Glue jobs
  - dbt Cloud jobs, if the dbt Cloud webhook sends the Run started event. See the [Configure webhooks](https://docs.datadoghq.com/data_observability/jobs_monitoring/dbt.md#configure-webhooks) section of the dbt page.
  - dbt Core jobs that send OpenLineage events
  - Custom OpenLineage jobs that send a `START` event when each run begins
- **Completed runs**: The monitor evaluates the final duration when a run finishes. This includes deferrable Airflow tasks, Azure Data Factory pipelines, Databricks jobs, dbt Cloud models and tests, and Spark batch jobs. dbt Cloud jobs without a Run started event are evaluated at completion if the webhook sends the Run completed event.
- **Recovery**: The monitor can recover when a later run finishes within the threshold or the learned bound.

## Example monitors{% #example-monitors %}

{% tab title="Row count drop" %}
Detect a significant decrease in row count that could indicate a pipeline failure or missing data.

1. Select Table > Row Count and choose the target table (for example, `ANALYTICS_DB.PROD.EVENTS`).
1. Select Anomalies as the detection method. The monitor triggers when the row count deviates from its historical baseline.

{% /tab %}

{% tab title="Stale table" %}
Alert when a critical table has not been updated within the expected time window.

1. Select Table > Freshness and choose the target table (for example, `ANALYTICS_DB.PROD.ORDERS`).
1. Select Thresholds as the detection method.
1. Set the Alert threshold to **6 hours** and optionally a Warning threshold at **4 hours**.

{% /tab %}

{% tab title="Null percentage spike" %}
Detect when a column's null percentage exceeds normal levels, which may indicate data ingestion issues.

1. Select Column > Nullness and choose the target column (for example, `ANALYTICS_DB.PROD.USERS.EMAIL`).
1. Select Anomalies as the detection method.

{% /tab %}

{% tab title="Rows lost between source and target" %}
Detect rows dropped between a source table and its destination after a replication or migration.

1. Select Source to Target, then choose the source table (for example, `POSTGRES_DB.PUBLIC.ORDERS`) and the target table (for example, `ANALYTICS_DB.PROD.ORDERS`).
1. Select Row Count as the metric type and set Format to Difference.
1. Select Thresholds as the detection method, set the comparison to less than, and set the Alert threshold to `0`. The monitor alerts when the target has fewer rows than the source.

{% /tab %}

{% tab title="Long-running job" %}
Alert when a nightly job runs past its expected window, while the job is still running.

1. Select Jobs, set Technology to DAG under Airflow, and filter to the DAG to watch (for example, `name:nightly_orders_load`).
1. Under Add checks, select Job duration and choose Thresholds.
1. Set the Alert threshold to `2 hours` and optionally a Warning threshold at `90 minutes`.
1. Optionally, also select Job failure to get an alert when the DAG fails.

{% /tab %}

## Annotate bounds{% #annotate-bounds %}

For monitors using the Anomalies detection method, you can annotate bound ranges to provide feedback and improve the model over time. Unlike infrastructure metrics, data quality metrics are often business-specific, so use annotations to teach the model what behavior is normal for your data. For Job duration monitors, use annotations to teach the model which job run durations are expected.

{% image
   source="https://docs.dd-static.net/images/monitors/monitor_types/data_observability/annotate_bounds.42e16328fdd525848c44241c1b7a7a68.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/monitors/monitor_types/data_observability/annotate_bounds.42e16328fdd525848c44241c1b7a7a68.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="Hover menu for annotating a monitor bound." /%}

On a monitor's status page, click Annotate Bounds, select a time range on the chart, and choose one of the following annotations:

| Annotation    | Description                                               |
| ------------- | --------------------------------------------------------- |
| Expected      | Expand bounds to include the marked behavior permanently. |
| Reset for now | Mark behavior as OK, but alert if it happens again.       |
| Missed alert  | Contract bounds to alert on this behavior.                |
| Ignore        | Exclude annotated data when modeling bounds.              |

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

Additional helpful documentation, links, and articles:

- [Data Observability Overview](https://docs.datadoghq.com/data_observability.md)
- [Quality Monitoring](https://docs.datadoghq.com/data_observability/quality_monitoring.md)
- [Jobs Monitoring](https://docs.datadoghq.com/data_observability/jobs_monitoring.md)
- [Configure your monitor notifications](https://docs.datadoghq.com/monitors/notify.md)
- [Schedule a downtime to mute a monitor](https://docs.datadoghq.com/monitors/downtimes.md)
- [Consult your monitor status](https://docs.datadoghq.com/monitors/status.md)
