31 / 35 · The Data System
Observing a data pipeline
Distinguish run success, source lag and output freshness, then trace a missing store to the stage that needs attention.
At 10:15 the sales pipeline shows a successful run at 10:14. A dashboard is complete only through 10:00. The last success describes a process. The dashboard’s cutoff describes the result. A recent success can coexist with a stale result if the job processed only older inputs.
Measure the result from the reader’s side#
Let be the observation time and the end of the contiguous sequence of complete and published intervals, starting at the dashboard’s first expected interval. Define output staleness as . At 10:15 the staleness is 15 minutes. The latest success was 1 minute ago. Use the 15-minute measure for a freshness objective about the dashboard. The measure depends on a defensible completion signal. A maximum event timestamp does not establish completeness. Beyer et al., Monitoring Distributed Systems
An alert can say that a report is more than 10 minutes behind its expected coverage. At 10:15 the sample crosses that threshold. For the next interval the system expects 500 store completion records and has received 499. That count localizes the gap to input coverage. It says nothing yet about whether the source is delayed, the extraction is stuck or a check quarantined one store.
Three clocks in one successful run
Locate the delay#
For a log-backed input, compare the end offset with the consumer group’s committed next offset for each partition. If these are 10100 and 10040, the distance is offsets. It is not an age in seconds. The offset distance can also differ from a count of visible records when there are gaps. Kafka reports consumer lag metrics, whose exact reference point depends on which metric is used. Apache Kafka, Monitoring
An offset can advance before the result is visible, or a consumer can process records and delay committing offsets. Check the position and the sink publication separately. For example, if the missing store’s completion record exists at offset 10050, the committed position 10040 does not establish that it was processed. A committed position past 10050 with no published store instead directs attention to validation or delivery after consumption.
Correlate evidence without copying the data#
Use the data interval, run ID, input snapshot and output version to connect events across stages. A trace represents related operations as spans. It can show that most of one run’s time was spent waiting for extraction rather than aggregating. A log entry can record the rejected rule and a reference to the offending key, and a metric can count rejections by dataset. Each signal answers a different question. OpenTelemetry, Traces
Avoid adding a separate metric label value for every order. That makes the number of time series grow with the number of orders. Keep the metric on stable dimensions such as source or stage. Use restricted logs or sampled traces for per-run evidence and exclude the personal payload when identifiers and counts suffice.
Next#
Freshness, missing inputs and recovery all constrain the design. Architecture and cost compares options with those constraints written down.
References#
- Betsy Beyer et al., eds. Monitoring Distributed Systems. Site Reliability Engineering, O’Reilly, 2016. Distinguishes user-facing signals from internal diagnosis.
- Apache Kafka. Monitoring, Kafka 4.2. Describes consumer position and lag metrics.
- OpenTelemetry. Traces. Defines traces and spans and their context.