Area: Observability Issues
Sub-Area: Anomaly Detection (formerly Smart Assertions) / Anomaly Feedback
Applies to: Cloud
Issue
An Anomaly Detection assertion (formerly called a Smart Assertion) fails on a real data incident, such as a genuine volume spike on an append-only table. You want the model to keep alerting on similar events. The run popover offers two feedback buttons, and neither one means "this was a real incident":
- Not an Anomaly (the docs call this action "Mark as Normal") tells the model the point was normal and puts it back into the training data.
- Train as New Normal excludes all training data before that run, so the model starts over from that point.
You Might Be Asking
- How do I tell DataHub that a fired assertion was a real incident so it keeps alerting on similar events?
- Does clicking "Mark as Normal" (Not an Anomaly) on a correct alert stop future alerts?
- What is the difference between "Not an Anomaly" and "Train as New Normal"?
- Why isn't my assertion producing predictions for days after I clicked "Train as New Normal"?
- Why did the model stop alerting after a confirmed incident on a very large table?
- Why was no incident created when my assertion failed?
Cause
When an Anomaly Detection assertion fails, DataHub records an anomaly event for that run automatically. Nobody needs to review it. When the model retrains, it leaves out every data point that has an anomaly event, unless someone marked that event as not an anomaly. An unreviewed anomaly and a confirmed anomaly are treated the same way: both stay out of the training data.
The feedback buttons change this:
- Not an Anomaly sets the anomaly to rejected. The model then trains on that point as normal data and widens its expected range, so a similar spike is less likely to alert again. After you click it, the UI shows "Marked as Normal. Retraining started."
- Train as New Normal adds an exclusion window that covers all data from the beginning up to that run. The model then trains only on data collected after the run. After you click it, the UI shows "Excluded all training data before this run."
Solution
If the alert was correct, don't click either button
Close the popover and handle the incident. The fired anomaly is already kept out of the training data, so the model keeps its sensitivity and will alert on a similar event. You don't need a "true positive" button for this.
If you clicked "Not an Anomaly" by mistake
- Open the assertion and hover over the same result dot on the results timeline.
- Click Undo. This marks the point as an anomaly again, and the model leaves it out of training on its next retrain.
If you clicked "Train as New Normal" by mistake
The model needs new history before it can produce new predictions. By default that is 14 days for volume assertions and 7 days for freshness, column metric and custom SQL assertions. To restore the old training data instead of waiting:
- Open the assertion and go to its Settings tab, or click Tune Predictions.
- Under Exclusion Windows, remove the window named "Retrained as new normal from
". - Save. The model retrains with the earlier data on its next training run.
If the model already stopped alerting on similar events
- If you know of a past run that should have alerted but passed, mark it. For volume, column metric and custom SQL assertions, hover over that result dot and click Mark as Anomaly. For freshness assertions, click Tune Predictions and mark the anomalous operations there. Marked points are left out of training.
- Click Tune Predictions and add an exclusion window over any older period that held real incidents and is now part of the training data.
- Raise the sensitivity on the Settings tab. A higher sensitivity gives a tighter fit and flags smaller deviations.
See Anomaly Detection: Anomaly Feedback and Tuning.
Very large metric values before DataHub Cloud v2.0.1
Before DataHub Cloud v2.0.1, the model matched anomalies to training points by timestamp and by value. The copy of the value stored with the anomaly loses precision above about 16.7 million. For volume, column metric and custom SQL assertions with values that large, fired anomalies did not match their training points, so the model trained on them as normal data and stopped alerting on similar spikes. DataHub Cloud v2.0.1 matches by timestamp only. The fix applies to anomalies that were recorded before the upgrade, so you don't need to re-mark them. If you are not sure which version you run, contact DataHub Support.
Make sure failures create an incident
An assertion failure creates an incident only if the assertion has the incident action turned on.
- Open the dataset and go to the Quality tab, then Assertions.
- Open the assertion and go to its Settings tab.
- Check Auto-raise incident. You can also check the option to auto-resolve the incident when the assertion passes again.
- Click save.
To send assertion failures to an external tool such as PagerDuty or Jira Service Management, subscribe to the "Completed Assertion Run Event" (category RUN, operation COMPLETED, runResult of FAILURE). You can read these events with the DataHub Cloud Event Source in a DataHub Actions pipeline, or receive them through AWS EventBridge. The event format is in the Entity Events API docs.
Additional Notes
- Anomaly Detection is GA for Volume and Freshness assertions and in Public Beta for Column Metric and Custom SQL assertions.
- A new Anomaly Detection assertion collects history before it starts alerting. The docs give 14 days for a new assertion. Backfill Assertion History can skip that wait for assertions that support it.