Skip to content

Lesson 9 of 9 · 24m

Monitoring Drift and Operating the Dataset

Operate scraping as a data product: detect site drift, monitor quality and cost, manage incidents, retire data, and document provenance.

The scrape is not done when rows appear. Web data decays because sites redesign, entities disappear, parsers drift, upstream licenses change, and the meaning of a field quietly shifts. If you cannot tell whether zero rows means "no data" or "selector broke," you do not have a dataset — you have a recurring surprise.

Measure the pipeline, not just the crawler

At minimum track:

fetch and parse success      by host, status class, extractor version
record yield                 entities per list page over time
validation and duplicates    by field, failure type, duplicate class
freshness, request volume    observed lag and planned versus actual retries
cost                         compute, bandwidth, browser time

Suddenly perfect extraction can be as suspicious as sudden failure. If a page used to yield twenty products and now yields one with no validation errors, the template probably changed.

Alerts need meaning

Bad alert: "job failed." Good alert: "parse yield dropped below 70% of trailing median for three consecutive runs while fetch success remained above 95%." That separates target drift from network failure.

alert: ProductExtractionDrift
expr: product_rows_extracted / product_pages_fetched < 14
for: 3h
labels: {severity: warning}
annotations: {summary: extraction yield low while fetches succeed}

Thresholds should come from measured baselines, not universal magic numbers.

Drift response is a workflow

When a site changes, do not hot-patch production extraction directly:

1. freeze promotion; inspect raw captures and rendered DOM
2. add a failing fixture and update the extractor in a branch
3. replay into staging; compare schema, counts, null rates, samples
4. promote and annotate the dataset changelog

This is tedious the first time and indispensable the tenth time.

Publish provenance with the data

Consumers need to know what they are using:

{
  "dataset": "book_price_observations",
  "source_policy": "public-pages-low-volume",
  "schema_version": "product_observation.v2",
  "extractor_version": "books-extractor 1.5.0",
  "generated_at": "2026-11-30T12:00:00Z",
  "quality": {"fetch_success": 0.998, "parse_success": 0.991, "validation_failure": 0.006}
}

Provenance is not paperwork. It is what lets downstream users assess fitness, reproduce analysis, and delete the right records when obligations change.

Retirement is part of operations

Sources should be retired when permission changes, value disappears, or cost exceeds benefit. Data should be expired under retention policy. Delete propagation must include derived tables, exports, caches, backups where feasible, and downstream copies you control. Document exceptions rather than pretending deletion is perfect.

Field notes

  • Monitor empty results separately from zero matching entities; they are operationally different.
  • Never let a monitoring crawler ignore the production crawl budget because it is "just checking."
  • Keep a runbook for blocks, drift, validation spikes, and storage pressure.
  • Sample records manually. Metrics cannot tell you that a title shifted into a price field without semantics.
  • Dataset operations includes ethics review on change: new fields, new purposes, and new sources all reopen earlier boundary decisions.

Was this lesson helpful?

Sign in to rate