{"canonical_url":"https://engineer.company/glossary/event-time/","content_markdown":"# Event time\n\n## What it is\n\nEvent time is the time at which a recorded event occurred according to the\nsource responsible for it. For a temperature reading, it might be the instant a\nsensor measured the temperature. A collector may receive it later, and a stream\nprocessor might handle it after another wait. Those are separate times. A\nquestion about what happened during a particular hour needs the appropriate\ntimestamp from the event.\n\nA system also observes processing time, which is the time at the processor while\nit works. Processing time can be useful for measuring when a job ran or how long\ndata waited in the pipeline. Event time preserves the relationship between\nrecords and what they describe. An event can arrive after a later event because\nof offline operation, a retry, or a source that sends readings in batches.\n\nStream processors can use watermarks to track how far they believe event time\nhas advanced. A watermark is a signal about expected progress, used to decide\nwhen operations such as an hourly window can publish a result. Records can still\narrive after a window is first reported. The treatment of late data depends on\nthe application's policy. It may update the result, collect late records for\nanother process, or use an agreed deadline before issuing a final figure.\n\n## Why it matters\n\nImagine a network of monitors reporting outages. One monitor loses its\nconnection at the same time as the service it observes. It later delivers\nseveral records together. A report grouped by when its server processed the\nrecords would show those events late. A report grouped by when observations\nhappened can associate them with the original outage and compare them with\ninformation from other monitors. The two reports answer different questions and\nboth can be useful.\n\nLate data puts a price on early answers. An operations dashboard may benefit\nfrom an initial estimate that gets corrected a minute later. A statement that a\ncustomer will use to settle a bill needs a clearly defined point at which it\nbecomes final, along with a way to handle corrections after that point. Choose a\ndeadline with users and make it visible. A system that quietly changes old\nfigures can make otherwise correct calculations hard to trust.\n\nTimestamp quality matters as much as the choice of clock. A device can be\nmisconfigured or change timezones while offline. An event producer can confuse\nthe units of a timestamp or forget to record how it was derived. Give the source\ntimestamp a defined meaning and preserve provenance needed to inspect it. Track\nreceive time separately so that unusually late records and implausible future\ntimes can be investigated.\n\n## What it looks like in practice\n\nConsider a stream of geographic survey measurements taken at remote locations.\nAn illustrative event includes its measurement time, the time a collector\nreceived it and an identifier that stays stable on resend. The reporting task\ngroups records by their measurement hour and region. While connectivity is\nnormal, several windows can be open at once. A watermark advances as inputs\nprovide evidence about the latest expected times. Once the reporting threshold\npasses, the job can emit a partial or complete result according to the agreed\npolicy.\n\nTest a normal hour, a device that sends the previous hour after reconnecting,\nand a period when one input goes quiet. With some stream-processing setups a\ncombined watermark depends on the slowest active input. An idle source can\ntherefore delay windows even though other inputs continue. Give the job a policy\nfor identifying idle partitions and bring the delayed records back in a\ncontrolled test. Measure how long it takes readers to see a value and how they\nrecognise a correction.\n\nEngineer's\n[GIS pipeline automation case study](/portfolio/automated-delivery-of-20-gis-data-pipelines/)\ndescribes making schedules, logs and failure handling consistent across real\ndelivery jobs. It provides a useful context for the timing decisions in this\nexample. A pipeline can run on schedule and still publish late or incomplete\nsource observations. Track the age of the data and the state of the delivery\nseparately so users know what the result represents.\n\n## Where it goes wrong\n\nA job may use the convenient receive timestamp because every record already has\none. During a replay, the same historical data can then be assigned to a later\nhour. Make the timestamp assigned to the occurrence explicit in the record\ndefinition and test it through a replay. A corrected occurrence time needs an\nintentional policy as well, because it can move a record from one report to\nanother.\n\nA reporting calendar may use local civil time, while the data stores each event\nas an unambiguous instant. Around a daylight-saving change, an hour can\ndisappear or occur twice in that local calendar. Include the reporting timezone\nand the offset where the displayed label would otherwise be ambiguous. A fixture\nthat crosses a clock change can reveal an unnoticed assumption about the number\nof periods per day.\n\nAnother common problem is a mismatch between how a processor updates results and\nhow a downstream reader stores them. A corrected hourly total might be emitted\nas a replacement. A consumer that appends both output records and sums all rows\ncan count the same hour twice. Choose a stable key for the hour and region and\ndocument whether the output represents a replacement, a change or a new\nhistorical edition. Test a late record all the way through the final report.\n\nKeep the measurement of delay visible. Count records that arrive after the\ninitial deadline and after the final correction window. Check event times ahead\nof the expected clock and inputs that stop reporting. A faster initial result\ncan be valuable. Its meaning stays clearer when readers can see whether it is\nprovisional, when it may be revised, and which sources contributed.\n\n## Further reading\n\n- [Apache Flink streaming analytics and event time](https://nightlies.apache.org/flink/flink-docs-stable/docs/learn-flink/streaming_analytics/).\n  Introduces time-based stream calculations and watermarks.\n- [Apache Flink guidance for debugging event time](https://nightlies.apache.org/flink/flink-docs-stable/docs/ops/debugging/debugging_event_time/).\n  Describes ways to investigate stuck windows and delayed progress.\n- [Google's Dataflow model paper](https://research.google/pubs/the-dataflow-model-a-practical-approach-to-balancing-correctness-latency-and-cost-in-massive-scale-unbounded-out-of-order-data-processing/).\n  Examines latency, completeness and revisions in out-of-order processing.\n\n\u003chttps://engineer.company/glossary/event-time/\u003e\n","date_modified":"2026-11-25T07:18:46Z","description":"Use event time to group delayed readings, advance a watermark and decide how to account for late arrivals.","formats":{"gemtext":"https://engineer.company/glossary/event-time/index.gmi","gopher":"https://engineer.company/glossary/event-time/gophermap","html":"https://engineer.company/glossary/event-time/","json":"https://engineer.company/glossary/event-time/index.json","markdown":"https://engineer.company/glossary/event-time/index.md","pdf":"https://engineer.company/glossary/event-time/index.pdf"},"kind":"page","language":"en","title":"What is event time?","url":"https://engineer.company/glossary/event-time/","version":1}