Course menuDVA-C03

Exams / DVA-C03 / Tracing with X-Ray / Question 2

DVA-C03 practice question: Tracing with X-Ray (2 of 2)

Troubleshooting and Optimization A free question from our original DVA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A checkout API is an Amazon API Gateway REST API that invokes a Lambda function.

Operations want production traces with two segments per request, one for API Gateway and one for the function, so they can see where the time goes. The function's code must not change, and the team wants its execution role to stay limited to what it needs.

Which TWO actions are required? (Choose two.)

Choose two answers.

  1. A. Enable X-Ray tracing on the API Gateway stage, so the API's segment is recorded.
  2. B. Run the X-Ray daemon on an EC2 instance in the function's VPC and point the function at it.
  3. C. Turn on CloudTrail data events for the function so that its invocations are traced.
  4. D. Turn on active tracing for the function, and make sure its execution role allows X-Ray writes.
  5. E. Turn on detailed CloudWatch metrics for the API Gateway stage, so that segments appear.
Show the answer and explanation

Answers: A, D

  • A. Right: Correct. API Gateway records a segment for each request only when tracing is enabled on the stage. The setting needs no code change. Learn more: Set up AWS X-Ray with API Gateway REST APIs (opens in a new tab)
  • B. Wrong: Lambda sends trace data from its own managed environment, so the function does not need a daemon on an EC2 instance. This adds work with no effect on the segments.
  • C. Wrong: CloudTrail records API activity for auditing. It does not record X-Ray segments or show request timing.
  • D. Right: Correct. Active tracing makes Lambda send a function segment to X-Ray. The execution role must allow the X-Ray write actions, and this is set in the function's configuration, not in its code. Learn more: Visualize Lambda function invocations using AWS X-Ray (opens in a new tab)
  • E. Wrong: Detailed metrics add CloudWatch metrics for the stage's requests. They do not create X-Ray segments or join the two services' traces.

Explanation

End-to-end traces need every service in the path to record its own segment. The API Gateway stage must have X-Ray tracing on, and the Lambda function must have active tracing with an execution role that allows X-Ray writes. CloudTrail and metrics do not create trace segments.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on Tracing with X-Ray? The 5 full-length practice sets have 11 more Tracing with X-Ray questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets