End-to-end tracing of the Node.js application
In the last section, we saw how to enable enhanced metrics for gathering additional metrics for Lambda functions. Let’s enable X-Ray active tracing. Active tracing is a feature of AWS X-Ray that provides visibility into the performance of your serverless applications. When enabled, active tracing captures detailed information about the flow of a request as it travels through the different components of your application, such as AWS Lambda functions, API Gateway, and DynamoDB. To gain a deeper understanding of AWS X-Ray and explore the various console-level options available in CloudWatch X-Ray, please refer to Chapter 4, Implementing Distributed Tracing Using AWS X-Ray.
Let’s enable active tracing for both the API Gateway and the Lambda function using the CloudFormation template in step 3. I describe changes made in the CloudFormation template in steps 1 and 2 as follows:
- To enable active tracing for the Lambda...