Area: Observability
Sub-Area: Data Quality
Applies to: Cloud
Issue
You get alerts from DataHub Cloud assertions or from dbt tests reported into DataHub. The checks fail, but the data is correct. The failures can last for days and then stop.
You Might Be Asking
- Why do my assertions fail when the data is fine?
- How do I find which assertions are flaky?
- How do I reduce false alarms from anomaly-detection (smart) assertions?
- How do I check what a failed run actually measured?
- How do I get fewer alerts from one noisy assertion?
Cause
Common causes of false positives:
- Timing. You set an assertion's evaluation schedule when you create it. If the schedule runs before your data lands, the check fails. On platforms without active-query support, assertions run in ingestion-driven mode. Their results refresh only as often as DataHub ingests the metadata (Operations, dataset profiles or schema).
- Anomaly-detection baseline. A smart assertion learns from history. Bad historical periods, high sensitivity or a real jump to a new normal value can make it fail on healthy data.
- Wrong pass condition on a Custom SQL assertion. The query returns one numeric value. The condition you pick under "Pass if resulting value" decides pass or fail. A result of 0 has no built-in meaning.
-
Query or connection errors. Custom SQL assertions run through the connection of the ingestion source that ingested the table. Errors such as "Unable to retrieve valid connection for Data Platform with urn
" or "Missing connection URN for SQL assertion evaluation" mean the executor has no usable connection from that source. -
Stale dbt results. DataHub reads dbt test results from the
run_results.jsonfiles you list inrun_results_paths. Results change only when you ingest new files.
Solution
-
Find the flaky assertions. Open the Data Health Dashboard under Observe in the sidebar and go to the Assertions tab. Use the By Assertion view. Set a time range such as Last 7 Days and set Results to At least one failure. You see which assertions failed and how often they fail relative to how often they run. Details: Data Health Dashboard.
-
Check timing. Compare the evaluation schedule with the time your data arrives. Set the schedule to run after the data lands. For ingestion-driven assertions, compare the result time with your ingestion schedule.
-
Tune smart assertions. Open the assertion page (or its Settings tab) and use Tune Predictions:
- Add Exclusion Windows for bad historical periods.
- Lower the Sensitivity.
- Adjust the training data lookback window.
- If a jump is the new baseline, mark the run "Train as New Normal". This excludes all earlier data from training.
Details: Anomaly detection.
-
Check Custom SQL logic. Make sure the query returns one row with one numeric column. Make sure the condition (Is equal to, Is not equal to, Is greater than, Is less than, Is within a range, Grows at least, Grows at most, or Grows within a range) matches what a healthy value looks like. Use the fully qualified table name, and make sure the user in the ingestion source has read access to the table. In the builder, "Try it out" tests the query. It is not available for sources that run on a Remote Executor. Details: Custom SQL assertions.
-
Check dbt results. Make sure your dbt ingestion recipe sets
run_results_pathsto yourrun_results.jsonfiles. Without it, test results are not populated in DataHub. Details: dbt source. -
Review what failed runs measured. Query the GraphQL API at
https://<your-account>.acryl.io/api/graphqlwith a personal access token as the Bearer token. Pass or fail is inresult.type(INIT, SUCCESS, FAILURE or ERROR). The countssucceeded,failedanderroredgive you a pass rate.query { dataset(urn: "<dataset_urn>") { assertions(start: 0, count: 20) { assertions { runEvents(limit: 50) { total succeeded failed errored runEvents { result { type actualAggValue } } } } } } }runEventstakesstatus,startTimeMillis,endTimeMillis,filterandlimit. It has nostartorcountargument. Without a time range it returns the most recent events up tolimit. Details: Assertions API. -
Reduce alert noise.
- Subscribe to only the assertions you care about. Click the bell on a single assertion and choose when to be notified, or subscribe on the dataset page with Subscribe and enable Assertion status notifications. Details: Subscribing to assertions.
- Use failure severity to rank alerts. Each run carries LOW, MEDIUM or HIGH severity. For Volume, Custom SQL and Column assertions you can set a default severity and numeric severity rules, and the highest matching rule wins. Anomaly-detection assertions do not support manual severity.
If false positives continue, contact DataHub Support. Include the assertion URNs, the timestamps of failures and later successes, and the assertion configuration.