Monitoring ML Jobs and Endpoints for Errors and Anomalies
This lesson explains how to monitor the jobs and endpoints around a model, which can crash, stop, return errors or slow down, to detect anomalies and errors as the exam guide asks.
Learning outcomes
After completing this lesson, you will be able to:
- Interpret endpoint metrics such as 4XX and 5XX errors.
- Alert on job and pipeline failures with EventBridge.
- Use CloudWatch anomaly detection.
Endpoint metrics
SageMaker AI endpoints publish CloudWatch metrics per variant. Invocations counts requests; Invocation4XXErrors indicate bad requests from clients, such as malformed payloads; Invocation5XXErrors indicate failures in the model or container; ModelLatency is the time the container takes; OverheadLatency is time added by SageMaker AI; and CPUUtilization, MemoryUtilization and GPU metrics show resource pressure. Container logs go to CloudWatch Logs under /aws/sagemaker/Endpoints/.
Endpoint metrics
Job and pipeline events
Training and processing jobs run without anyone watching, so failures must be reported automatically. SageMaker AI emits Amazon EventBridge events for state changes of training, processing and transform jobs, pipeline executions and steps, endpoints and model package approvals. AWS Glue, Step Functions and Bedrock batch jobs emit similar events.
EventBridge rules that match Failed states send notifications through Amazon SNS or start remediation with Lambda, such as retrying a job. CloudWatch Logs Insights queries then search the job logs for the cause, such as out-of-memory errors or missing input files.
The following diagram shows the alerts that catch a failing batch transform job, and the fix.

Catch failed jobs
Anomaly detection
Fixed thresholds miss unusual patterns in metrics that vary by time of day. CloudWatch anomaly detection learns a metric's expected band and alarms when values leave it, which suits invocations, latency and data volumes. Metric filters turn log patterns, such as "ValidationError", into metrics. Amazon DevOps Guru also detects operational anomalies, but it is not open to new customers from 29 October 2026 and reaches end of support on 30 September 2027, so AWS recommends CloudWatch anomaly detection instead. The following table summarises the signals.
| Signal | Indicates | Response |
|---|---|---|
| Invocation4XXErrors rising | Client sending bad requests | Check client payload changes |
| Invocation5XXErrors rising | Model or container failures | Check container logs, roll back |
| ModelLatency high | Slow model or saturated instances | Scale, optimise, check utilisation |
| OverheadLatency high | Platform overhead, often payload size | Reduce payload or review configuration |
| Job state Failed event | Pipeline or job failure | SNS alert, Lambda remediation |
| Metric outside anomaly band | Unusual behaviour | Investigate |
Silent failure
A nightly batch transform job that scores customers failed for three nights in a row with an out-of-memory error. Nobody noticed until marketing used stale scores.
- Create an EventBridge rule matching SageMaker transform job state changes with status Failed, targeting an SNS topic for the on-call team.
- Add a CloudWatch alarm on the age of the latest output file, catching jobs that never ran.
- Increase the instance memory or reduce MaxPayloadInMB and use SplitType=Line to fix the out-of-memory error.
Event-based alerting catches failures within minutes, and the freshness alarm also catches the case where the schedule itself stops.
Rising 5XX errors on an endpoint point to what?
Show answer
The model or its container. 4XX errors point to the clients.
Exam Tips
Remember for the exam
- 4XX errors point to clients; 5XX errors point to the model or container.
- ModelLatency is the container's time; OverheadLatency is SageMaker AI's.
- Alert on failed jobs and pipelines with EventBridge rules and SNS.
- Metrics with daily patterns: CloudWatch anomaly detection.
- DevOps Guru is not open to new customers from 29 October 2026; prefer CloudWatch anomaly detection.