Explore Lambda Insights

Go to CloudWatchLambda InsightsMulti-Function. You can select the four Lambda functions which are created by our application and look at their metrics.

Lambdainsights multi-function

Under Lambda InsightsSingle-Function, we can see the individual function metrics like CPU, Memory and Network Usage.

Lambdainsights single-function

Lambda Insights is integrated with ServiceLens. You can view x-ray traces by clicking on View shown below for a particular function execution.

Lambdainsights x-ray

Lambdainsights x-ray

Rightsizing the Lambda Functions.

Looking at memory utilization for each of the Lambda functions-

  • Services-StepFnlambdasteppriceGreaterThan55AD1EC03-13QX5IKNCBW2J
  • Services-StepFnlambdasteppriceLessThan556D8B304A-4100A3XLT1UL
  • Services-StepFnlambdastepreadDDBF7497E96-16PQGYSUZG8GP
  • Services-statusupdaterservicelambdafn37242E00-PSI4804K4LDN

We see that % utilization of memory is high.

Lambdainsights memory-utilization

Lets increase the memory allocated to each of the Lambda functions. You can do that using AWS Lambda Console or AWS CDK. The AWS CDK code changes will look like below:

status-update-services.ts Lambdainsights cdk1

stepfn.ts Lambdainsights cdk2

Change the two files and execute “cdk deploy” to push the changes to Lambda functions. We can see changes in Duration and Memory Usage (Max) metrics.

Lambdainsights multi-function