event_freshness_anomalies
Feb 24, 2026
·
5
min read
Anomaly detection, Freshness
·
elementary
·
Model,Source
How it Works
The event_freshness_anomalies test from the Elementary dbt package detects anomalies in the time gap between when events occur and when they arrive in the data warehouse. Unlike freshness_anomalies which looks at the last update time, this test focuses on the lag between event time and ingestion time, catching delays that would affect real-time or near-real-time analytics.
Steps and Conditions
Event Timestamp: Specify the column representing when the event occurred.
Update Timestamp: Specify the column representing when the record was ingested.
Baseline Period: Historical event-to-ingestion lag patterns form the baseline.
Execution: The current lag distribution is compared to historical norms.
Outcome: Pass if the lag is within normal bounds; fail if anomalous delays are detected.
Example Usage: Real-time Analytics
A real-time analytics platform processes clickstream events. The team wants to detect when the pipeline is introducing unusual delays between user actions and data availability.
An unusual spike in event-to-ingestion lag signals a pipeline bottleneck before it impacts dashboards relying on near-real-time data.





