MLA-C01 Practice Question 69: X-Ray Latency Tracing
AWS Certified Machine Learning Engineer – Associate (MLA-C01) · Test 7 · question 9 of 10
A pricing API runs on Amazon API Gateway and an AWS Lambda function. For each request, the function reads customer features from Amazon DynamoDB, calls a SageMaker AI real-time endpoint, and applies business rules. P99 latency has risen from 400 ms to 2.5 seconds. The endpoint's ModelLatency and OverheadLatency metrics are unchanged. The team needs to see, for individual slow requests, how much time each downstream call took.
What should the team do?
Show answer and explanation
Answer:
AWS X-Ray traces a request as it moves through services. With active tracing, Lambda creates trace segments for each invocation and sends them to X-Ray, and API Gateway can trace the front of the request. Instrumenting the function's AWS SDK clients adds a subsegment for each call to DynamoDB and to the SageMaker AI Runtime. The trace timeline for a slow request then shows exactly where the time went, and the service map shows the pattern across requests. Since the endpoint's own latency metrics are flat, the trace will point to DynamoDB, the business rules, or cold starts (option D).
- A is wrong because Duration is the total time for each invocation. It confirms the function is slow but cannot break that time down across the DynamoDB call, the endpoint call, and the function's own code. - B is wrong because CloudTrail records API activity for auditing, not how long calls took, and it does not link a DynamoDB read and an endpoint call to the same user request. - C is wrong because data capture records model inputs and outputs for quality monitoring. It says nothing about latency, and the endpoint's latency metrics already show the model is not the bottleneck.
Reference: Visualize Lambda function invocations using AWS X-Ray