Performance Tracing

AWS X-Ray helps developers analyze and debug production, distributed applications, such as those built using a microservices architecture. With X-Ray, you can understand how your application and its underlying services are performing to identify and troubleshoot the root cause of performance issues and errors.

When SAM CLI created your application, it enabled X-Ray tracing for your HelloWorldFunction:

Resources:
  HelloWorldFunction:
    Type: AWS::Serverless::Function
    Properties:
      Tracing: Active # https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html

This means you can go directly to the X-Ray console and begin gaining an understanding of your application's performance right away.

Exercise

Using a load balancing tool such as Artillery, send enough requests (at least one thousand) to your function to gather meaningful performance data.

Sample load.yml for Artillery

Explore the data that X-Ray provides, including trace maps, histograms, and latency data.