Course contents 31 / 35

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.

Prerequisites

Access and privacy

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 tnowt_{now} be the observation time and tcompletet_{complete} the end of the contiguous sequence of complete and published intervals, starting at the dashboard’s first expected interval. Define output staleness as tnow−tcompletet_{now} - t_{complete}. 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.

Figure

Three clocks in one successful run

Three clocks in one successful runThe next interval lacks one store. The job last succeeded at 10:14, but the last complete output ends at 10:00.Next interval coverage499 of 500 stores readyLatest successful job10:14Complete output through10:00 · 15 minutes behind
The observation is at 10:15. The reader cares about the published complete interval, which ends at 10:00.

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 10100−10040=6010100 - 10040 = 60 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#

  1. Betsy Beyer et al., eds. Monitoring Distributed Systems. Site Reliability Engineering, O’Reilly, 2016. Distinguishes user-facing signals from internal diagnosis.
  2. Apache Kafka. Monitoring, Kafka 4.2. Describes consumer position and lag metrics.
  3. OpenTelemetry. Traces. Defines traces and spans and their context.