Take a look at the setup architecture on EC2 and on container environments such as ECS/EKS. X-Ray has an agent that runs as a separate process from your application. The X-Ray SDK collects traces from the application and sends them to the local agent over UDP. The agent then sends the traces to the X-Ray service using X-Ray APIs.
Go to AWS X-Ray Service map page You should be able to see a service map as shown below.
The Service map shows all the microservices and other components the application is making use of. When None is selected at the bottom right, you will be able to see the average response times and requests served by each service.
Health modes to see the size of the circles (nodes) adjusting to the reflect traffic and health status relative to other services in the application.
You can view upto 6 hours of trace data at any given point. Select the duration from the control at the top right as shown below.
If you’re not aware of basic X-Ray concepts, it would help to spend a few minutes to get clarity on Segments, Subsegments, Traces and more here before proceeding further.
View tracesto see all traces that are captured between these 2 services. If you are interested in only seeing traces that have higher response time greater than 3 seconds, you can filter those traces only by simply selecting that area of the graph with the mouse.
View traces. Clicking on a specific URL you’re interested will filter the traces for that URL and display them in the bottom table.
Learn about filter expressions here - https://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html
Learn about Annotations - https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-annotations
PayForAdoptionnode and click
View traces. Click the URL that ends with
/Payment/MakePaymentand select any one of the traces. Click on
Call Payment APIas shown in the screenshot below.
Annotationstab, you will be able to see the custom Annotations that were instrumented through the XRay SDK. You can see
PetTypebeing annotated in the trace.
Annotations are indexed and can be used to filter traces.
For example, a Filter expression like
annotation.PetType="puppy" will show me only the traces that have the annotations with PetType=puppy.
Metadatatab to see the metadata information that was added to the trace
XRay can also show details about the AWS service being used in the trace. For example, select
Invocation subsegment. Go to the
Resources tab and check details such as the table name, operation that was performed on the table etc. Go ahead and check this out for other services as well to see service specific information.