Course menuDVA-C02

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

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

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

A REST API in Amazon API Gateway invokes a Lambda function. The developer wants AWS X-Ray to show each request's path from API Gateway through the function, including segments recorded by Lambda. Which TWO actions are needed? (Choose two.)

Choose two answers.

  1. A. Enable X-Ray tracing on the API Gateway stage.
  2. B. Run the X-Ray daemon on an EC2 instance in the same VPC as the function.
  3. C. Enable CloudTrail data events for the Lambda function.
  4. D. Turn on active tracing for the function, with xray:PutTraceSegments and xray:PutTelemetryRecords in its execution role.
  5. E. Enable detailed CloudWatch metrics on the API Gateway stage.
Show the answer and explanation

Answers: A, D

  • A. Right: Correct. With stage tracing enabled, API Gateway records a segment for each request and passes the trace header to the function.
  • B. Wrong: Lambda sends trace data itself when active tracing is on. A separate daemon on EC2 plays no part.
  • C. Wrong: CloudTrail data events record Invoke API activity for auditing. They do not produce X-Ray traces.
  • D. Right: Correct. Active tracing makes Lambda send trace data, and the execution role needs these permissions, found in AWSXRayDaemonWriteAccess.
  • E. Wrong: Detailed metrics add per-method metrics. They do not create traces.

Explanation

End-to-end tracing needs each service in the path to take part. API Gateway REST APIs record trace segments when tracing is enabled on the stage, and Lambda sends traces when active tracing is on and its execution role can write to X-Ray. Traces then appear together on the X-Ray trace map.

Study

Keep practising

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