Maintained with ☕️ by
IcePanel logo

AWS Serverless Application Model CLI now supports enabling AWS X-Ray tracing

Share

Services

Now you can use the [AWS Serverless Application Model](/serverless/sam/) (AWS SAM) CLI to enable [AWS X-Ray](/xray/) tracing in your AWS SAM templates automatically, without manually authoring your AWS SAM templates. This makes it easier to centrally manage AWS X-Ray tracing across your Lambda functions in your serverless application. The AWS SAM CLI is a developer tool that makes it easier to initialize, build, package, test on local and cloud, and deploy serverless applications. [AWS X-Ray](/xray/) helps you analyze and debug your distributed applications, such as those built using a microservices architecture. AWS X-Ray provides an end-to-end view of requests as they travel through your application, making it easier to monitor and troubleshoot complex serverless architectures. Enabling tracing through the AWS SAM CLI reduces the complexity of setting up tracing on each of your Lambda functions. To enable tracing through the AWS SAM CLI, simply add --tracing flag to the sam init command invocation to activate tracing. You can enable tracing across all Lambda functions in your AWS SAM application, or for specific functions. For more information, see the AWS [SAM CLI documentation](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-init.html). The AWS SAM CLI supports enabling tracing for serverless applications in all [AWS regions](/about-aws/global-infrastructure/regional-product-services/) where AWS SAM CLI and AWS X-Ray are supported. You can install the AWS SAM CLI by following the instructions in the [documentation](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html).