liveBook · Manning

Monitoring

As explained in Machine Learning System Design

The practice of recording timestamped events, inputs, outputs, and contextual identifiers generated by a software system.

A model can be running without producing useful predictions. Monitoring checks software health, data quality, and model quality over time so problems can be detected and addressed before they undermine the system’s value. Logs provide the event-level context needed to investigate what happened. section 14.0 section 14.2

Record events and predictions with timestamps. Where feasible and affordable, log every prediction with its input features and model output. The cost matters: storing every intermediate output can significantly affect the profit margin. Make log messages specific enough to connect an event to its context. section 14.2

❌ logger.info("Fraud probability calculated")
✅ logger.info(f"Fraud probability = {score:.3f} for user id {user_id}")

A useful prediction log records the score and user identifier rather than merely saying that a calculation happened. section 14.2

Choose signals and responses for the system’s risks:

  • Track a few service-level indicators, such as request rate, errors, latency, and resource utilization. Connect alerts to incident management so someone can respond. section 14.2 section 13.3.1
  • Check data quality and integrity, including missing values, schema compliance, and unexpected feature ranges. section 14.5.1
  • Measure model quality when ground truth is available, including performance by segment. When feedback is delayed, use data and prediction drift as proxy signals. section 14.4.3
  • Prepare for a response: depending on the problem, retrain or rebuild the model, or use a backup strategy. Document expected failure modes and how to approach them. section 14.4.3 section 13.3.1

Logging a search request

For a stock-photo search system, record the original query, candidate document IDs, final top 20 results, and negative scenarios or fallbacks. Trace logs with user, session, and request IDs; the user ID may be absent when a user is not logged in. Latency metrics for candidate fetching, ranking, and overrides complement the logs. section 14.5.2

Monitoring batch forecasts

A demand-forecasting system can log prediction features, outputs, and timestamps while tracking request rates, resource use, errors, and latency. For its batch jobs, also track success and failure rates, duration, rows processed, validation checks, and prediction accuracy against actual demand. section 14.5.1 section 15.5.1

Use the organization’s existing log storage, metrics, and alerting practices where possible. Monitoring also applies during experiments: investigate problems promptly, and avoid excluding segments unless the initial experiment design allowed it. section 13.3.1 section 12.3

How Machine Learning System Design covers it

How deep it goes
Gives logging fields, metric categories, checks, alerts, and response options while deferring extensive software-reliability coverage.
Examples
Uses stock-photo search logs, retail demand-forecasting metrics, and a contextual fraud-score log message.
What you can do after
Operate and configure monitoring by selecting signals, recording prediction context, and preparing responses to failures.
How it connects
Connects monitoring to service-level indicators, data drift, model quality, alerting, and incident management.

Also explained in

Compare how 41 books explain monitoring →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning System Design. The section links point to the parts of the book it draws on.