Skip to main content

Anomaly detection results

This document describes the data model and result fields for anomaly detection rules in Data Quality Studio, including how results flow from Snowflake to Atlan and what each field represents.

Rule attributes

When anomaly detection is enabled, two DataQualityRule entities are created with the following templates:

RuleTemplate nameDimensionDescription
Anomaly Detection - Row CountANOMALY_DETECTION_ROW_COUNTVolumeMonitors row count using Snowflake's native anomaly detection
Anomaly Detection - FreshnessANOMALY_DETECTION_FRESHNESSTimelinessMonitors data freshness using Snowflake's native anomaly detection

Result fields

Each anomaly detection result includes the standard DQ rule result fields plus additional ML-specific details.

Standard fields

FieldAttributeTypeDescription
Latest resultdqRuleLatestResultStringPASS or FAIL, indicating whether the actual value is within the expected range
Latest metric valuedqRuleLatestMetricValueStringThe actual measured value (for example, the row count or freshness value)
Result computed atdqRuleLatestResultComputedAtEpoch (ms)Timestamp when the result was evaluated
Metric computed atdqRuleLatestMetricValueComputedAtEpoch (ms)Timestamp when the metric was measured by the DMF

Anomaly detection fields

These fields are stored in the dqRuleLatestResultDetails attribute as a JSON string:

FieldKeyTypeDescription
ForecastforecastNumberThe ML-predicted expected value based on historical patterns
Upper boundupper_boundNumberThe upper limit of the normal range
Lower boundlower_boundNumberThe lower limit of the normal range
Is anomalyis_anomalyBooleantrue if the actual value falls outside the expected range; false otherwise

Example dqRuleLatestResultDetails payload:

{
"forecast": 1500.0,
"upper_bound": 1650.0,
"lower_bound": 1350.0,
"is_anomaly": false
}

Status values

The dqRuleADStatus attribute on the DataQualityRule entity tracks the anomaly detection lifecycle:

StatusDescriptionTransition trigger
TRAININGML model is collecting data and learning patternsSet when the rule is created (toggle turned on)
ACTIVEModel is producing predictions; results are flowingSet when the first AD results are published to Atlas
ERRORSync to Snowflake failedSet when the DQ event processor fails to sync the rule

Data flow

Anomaly detection results follow this pipeline from Snowflake to Atlan:

Snowflake DMF execution (with ANOMALY_DETECTION = TRUE)

SNOWFLAKE.LOCAL.DATA_QUALITY_MONITORING_ANOMALY_DETECTION_STATUS view

Scheduled task MERGEs into DQ_RULE_RESULT (with RESULT_DETAILS column)

fetch_dq_results reads DQ_RULE_RESULT (including RESULT_DETAILS)

Published to Kafka DQ_METADATA topic

Numaflow UDF renders Jinja2 template → Atlas bulk update

dqRuleLatestResult, dqRuleLatestMetricValue, dqRuleLatestResultDetails, dqRuleADStatus

Snowflake storage

In the customer's Snowflake warehouse, anomaly detection results are stored in DQ_RULE_RESULT with the RESULT_DETAILS column (type VARIANT) containing the ML output:

OBJECT_CONSTRUCT(
'forecast', forecast_value,
'upper_bound', upper_bound_value,
'lower_bound', lower_bound_value,
'is_anomaly', is_anomaly_flag
)::VARIANT

Atlas storage

The Numaflow pipeline publishes the following attributes to the DataQualityRule entity in Atlas:

  • dqRuleLatestResult: PASS or FAIL
  • dqRuleLatestMetricValue: the actual measured value
  • dqRuleLatestResultDetails: the JSON string with forecast, bounds, and anomaly flag
  • dqRuleADStatus: set to ACTIVE when results with result_details are present

See also