Course menuDOP-C02

Exams / DOP-C02 / Study guide / Distributed tracing with X-Ray

Distributed tracing with X-Ray: DOP-C02 study notes and practice questions

What to know about Distributed tracing with X-Ray for the DOP-C02 exam, from the Monitoring and Logging domain (15% of the exam guide), then 1 free question to test it. Part of the DOP-C02 study guide.

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

What to know for the exam

Tracing questions ask how to find which service in a chain causes latency or errors.

Concepts

  • A trace follows one request; segments are each service’s work; subsegments are calls inside it (database, HTTP, AWS SDK).
  • The trace map (service map) shows services, latency and error rates.
  • Annotations are indexed key-value pairs you can filter on; metadata isn’t indexed.
  • Sampling rules control how many requests are traced, keeping cost down.
  • Groups filter traces and can generate metrics and insights.
  • X-Ray Insights detects anomalies and opens notifications.

Instrumenting today

  • The X-Ray SDKs and daemon are in maintenance mode. Use OpenTelemetry:
    • AWS Distro for OpenTelemetry (ADOT) SDKs and collector.
    • The CloudWatch agent as an OpenTelemetry-compatible collector.
    • CloudWatch Application Signals for auto-instrumented service-level metrics, SLOs and traces.
  • On ECS, run a collector as a sidecar or daemon; on EKS, use the ADOT or CloudWatch Observability add-on.
  • Lambda: turn on active tracing; use the ADOT layer or Application Signals for richer data.
  • API Gateway and other services pass trace headers.

Using traces

  • Find the segment with the highest latency or fault rate.
  • Correlate with logs (trace IDs in log lines) and metrics.
  • Transaction Search in CloudWatch lets you search spans at scale.

Permissions

The task role, instance profile or function role needs permission to send trace data (xray:PutTraceSegments or the OTLP endpoint permissions).

Common traps

  • Recommending new X-Ray SDK or daemon deployments. Use OpenTelemetry.
  • Logs alone to find which hop is slow across many services.
  • Tracing 100% of requests at high volume when sampling is enough.

Try the 1 practice question

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

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

Study Distributed tracing with X-Ray

More Monitoring and Logging topics