概念 · SAA-C03 の発展
Logs and tracing to troubleshoot ML systems
Read the signal first: logs for container errors, traces for slow hops, CloudTrail for denied or failed API calls.
このレッスンはまだ翻訳されていないため、英語で表示しています。
Solutions Architect Associateで学んだこと
- X-Ray traces a request through services and draws a trace map.
- It samples requests and shows which part is slow or failing.
- Lambda and API Gateway can send traces when tracing is on.
Training job failed
- FailureReason and job logs
Endpoint returns 5XX
- Container logs, then metrics
Whole request is slow
- X-Ray trace map
AccessDenied or validation error
- CloudTrail event
Out-of-memory suspicion
- Memory metric and logs
| Symptom | Look at |
|---|---|
| Training job failed | FailureReason and job logs |
| Endpoint returns 5XX | Container logs, then metrics |
| Whole request is slow | X-Ray trace map |
| AccessDenied or validation error | CloudTrail event |
| Out-of-memory suspicion | Memory metric and logs |
概要
SageMaker AI sends container output to CloudWatch Logs: stdout and stderr from training jobs go to /aws/sagemaker/TrainingJobs, endpoints to /aws/sagemaker/Endpoints/your-endpoint-name, and processing jobs to /aws/sagemaker/ProcessingJobs. When a training job fails, the job description shows a FailureReason, such as AlgorithmError for a problem in the training code or ClientError for a configuration or permission problem. The log tells you the exact line. Use Logs Insights to search many streams at once, for example all lines with the word Error in the last hour.
概要
A trace answers a different question: where does the time go across services? In an app where API Gateway calls Lambda and Lambda calls a SageMaker endpoint, X-Ray tracing shows the time spent in each hop, so you see if the endpoint call or the pre-processing code is slow. The endpoint container itself shows up as one call; look in its logs for the inside.
概要
CloudTrail records API calls and their errors. If a job never starts or a call returns AccessDenied or ValidationException, the CloudTrail event shows who called what and the error message. Read the signal in order: a metric alarm tells you something is wrong, a trace tells you which hop, logs tell you why, and CloudTrail tells you which API call was refused.
覚えること
- Job and container logs go to CloudWatch Logs under /aws/sagemaker/.
- FailureReason on a training job: AlgorithmError for code, ClientError for setup or permissions.
- Logs Insights searches across log streams.
- X-Ray: which hop is slow, such as API Gateway, Lambda or an endpoint call.
覚えること
- CloudTrail: which API call was denied or failed, and why.
- Order: metric, trace, log, CloudTrail.
試験では
- “Training job failed, find the line of code” points to the job logs in CloudWatch Logs.
- “Which service in the chain adds the latency?” points to X-Ray traces.
- “Who called CreateEndpoint and got AccessDenied?” points to CloudTrail.
- “Search all endpoint logs for one error string” points to CloudWatch Logs Insights.
混同しやすいもの
- CloudWatch metrics and dashboards for MLKnow which endpoint and training metrics exist, where they live, and how to turn them into dashboards and alarms.
- Troubleshooting ML security issuesWork out whether a failure is a permission or a network path, then read the error and the CloudTrail event.
- Agent monitoring and AgentCore ObservabilityTraces show each reasoning step and tool call, so you can find loops, failing tools and handoffs that went wrong.
このタスクの内容 · 4.2
- Inference instance families
- Inference Recommender and right-sizing
- CloudWatch metrics and dashboards for ML
- Logs and tracing to troubleshoot ML systems
- Capacity, quotas and throttling
- Cost tools, tags and spending limits
- Purchasing options for ML infrastructure
- FM inference costs and token monitoring
- Reducing FM usage cost