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.
AA. 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.
BB. 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.
CC. 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.
DD. 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.
C. Wrong: An Application Load Balancer does not trace downstream calls made by the containers, so this does not show the slow service call. The team needs instrumentation in the application. Learn more: What is AWS X-Ray? (opens in a new tab)
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.
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 →