Course menuDOP-C02

Exams / DOP-C02 / Distributed tracing with X-Ray / Question 1

DOP-C02 practice question: Distributed tracing with X-Ray

Monitoring and Logging A free question from our original DOP-C02 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 SaaS startup runs its API as containers on Amazon ECS with AWS Fargate. Customers report that some requests take up to eight seconds, and the team cannot tell which service call inside the request path is slow.

The team wants to see the time each request spends in each downstream service, with the traces appearing in the X-Ray console. The team wants to use the tracing instrumentation that AWS recommends for new work, and it wants to avoid changing the container image's base operating system.

The tasks run with an IAM task role that the team manages in the same account.

Which approach meets these requirements with the LEAST operational overhead?

Choose one answer.

  1. A. Turn on CloudWatch Logs for each container and write timing lines in the application code, then build a dashboard that charts the timings for each downstream call.
  2. B. Add an OpenTelemetry collector or the CloudWatch agent as a sidecar container in each task, instrument the application with OpenTelemetry, and grant the task role permission to send trace segments.
  3. C. Turn on X-Ray tracing on the Application Load Balancer, which records the time spent in each service behind the load balancer for every request, including calls the containers make to other services.
  4. D. Install the CloudWatch agent in each container to collect CPU and memory metrics, and create alarms on the response time metric of the load balancer.
Show the answer and explanation

Answer: B

Explanation

X-Ray traces a request across services when the application is instrumented, here with OpenTelemetry because the X-Ray SDKs and daemon are in maintenance mode. On ECS, a collector or the CloudWatch agent runs as a sidecar container and sends the spans to X-Ray with the task role's permissions. Logs, load balancer settings and agent metrics do not show the time spent in each downstream call.

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 Distributed tracing with X-Ray? The 5 full-length practice sets have 7 more Distributed tracing with X-Ray questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets