event_freshness_anomalies
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.
models:
- name: clickstream_events
tests:
- elementary.event_freshness_anomalies:
event_timestamp_column: event_time
update_timestamp_column: ingested_atAn unusual spike in event-to-ingestion lag signals a pipeline bottleneck before it impacts dashboards relying on near-real-time data.
Interested to Learn More? Try Out the Free 14-Days Trial
One AI-native workspace to build, ship, and monitor dbt™ — without the tool sprawl.
Join industry leaders winning with DinoAI agents
Data engineers and analysts at the most AI-native startups and enterprises use Paradime's DinoAI agents everyday to become market leaders.