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}foruserid{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








































