Monitors the freshness of your table over time, as the expected time between data updates.
Upon running the test, your data is split into time buckets (daily by default, configurable with the time bucket field), and then we compute the maximum freshness value per bucket for the last training_period (by default 14 days).
The test then compares the freshness of each bucket within the detection period (last 2 days by default, controlled by the detection_period var), and compares it to the freshness of the previous time buckets. If there were any anomalies during the detection period, the test will fail.
models: - name:< model name >tests: - elementary.freshness_anomalies:timestamp_column:< timestamp column ># Mandatorywhere_expression:< sql expression >time_bucket:# Daily by defaultperiod:< time period >count:< number of periods >
models: - name:login_eventstests: - elementary.freshness_anomalies:timestamp_column:"updated_at"# optional - use tags to run elementary tests on a dedicated runtags: ["elementary"]config:# optional - change severityseverity:warn
Test configuration
Required configuration: timestamp_columnDefault configuration: anomaly_direction: spike to alert only on delays.
tests:— elementary.freshness_anomalies:timestamp_column:column namewhere_expression:sql expressionanomaly_sensitivity:intdetection_period:period: [hour | day | week | month]count:inttraining_period:period: [hour | day | week | month]count:inttime_bucket:period: [hour | day | week | month]count:intdetection_delay:period: [hour | day | week | month]count:intignore_small_changes:spike_failure_percent_threshold:intdrop_failure_percent_threshold:intanomaly_exclude_metrics: [SQL expression]