This sample code allows you to retrieve AWS XRay API - GetTraceSummaries (https://docs.aws.amazon.com/xray/latest/api/API_GetTraceSummaries.html) for Fault and Latency Notification using Lambda and SNS.
- Setup IAM Role for AWS Lambda a) Managed Policies - Basic Execution Role for Lambda to save console.logs to Cloudwatch Logs b) Managed Policies - AWS X-Ray Read-Access (you can also specify only GetTraceSummaries) c) Inline Policies - To send notification to SNS
- Setup SNS
- Setup EventBridge a) Trigger Lambda b) Scheduled timer for eg: every 15 minutes
- Setup Lambda a) Choose NodeJS b) Refer to the code sample c) Modify the High Latency value, SNS Topic ARN and Start Time/End Time