hands-on lab

Tracing Java Applications with AWS X-Ray

Up to 1h
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.


In this lab, you will be instrumenting a Spring Application that you will create in Cloud9 IDE which has APIs to insert data in a DynamoDB table and fetch the data from the table. AWS X-Ray helps you analyze your applications, it will help you understand how your application is performing. You will be able to troubleshoot the errors very easily. There are multiple ways for how you can instrument your application. In this lab, you will be using manual instrumentation.

There are a few definitions you should understand before starting the lab:

  • Traces are used to track the path followed by a request in your application.
  • Segments provide basic details about the resource name, details about the request. Segments can be broken into subsegments to provide more granular details about the request.

Learning Objectives

Upon completion of this lab you will be able to:

  • Insert data into DynamoDB tables
  • Fetch data from DynamoDB tables
  • Instrument applications with AWS X-Ray

Intended Audience

This lab is intended for:

  • QA engineers
  • Software Developers
  • Anyone interested in debugging


You should possess:

  • A basic understanding of Java
  • A basic understanding of the Spring Boot framework is helpful but not required
  • A basic understanding of using AWS SDK is helpful but not required

The following labs can be used to fulfil the prerequisites:


June 6th, 2023 - Updated instructions to improve clarity

April 25th, 2023 - Updated screenshots & instructions to reflect the latest Cloud9 UI

April 13th, 2023 - Updated screenshots & instructions to reflect the latest UI

March 12th, 2023 - Resolved an issue that caused the lab to fail to set up on rare occasions

May 26th, 2022 - Improved the instructions and added a screenshot

Environment before

Environment after

About the author

Learning paths

Andrew is a Labs Developer with previous experience in the Internet Service Provider, Audio Streaming, and CryptoCurrency industries. He has also been a DevOps Engineer and enjoys working with CI/CD and Kubernetes.

He holds multiple AWS certifications including Solutions Architect Associate and Professional.

Covered topics

Lab steps

Logging In to the Amazon Web Services Console
Opening the AWS Cloud9 IDE
Installing the Required Tools
Configuring the AWS DynamoDB SDK and AWS X-Ray SDK
Initiating the DynamoDB Client and Configuring the Segments
Starting X-Ray Daemon and Testing the Application
Finding and Understanding the Traces in the AWS Console