Lambda invocations with duration greater than a specific threshold

Returns the list of Lambda invocations with duration greater than specific thereshold

Cloudwatch Log Insights snippet that lists the invocations with duration greater than the specified thereshold of your Lambda Lambda function.

Copy the code into CloudWatch log insights

fields @timestamp, @message
|filter @type = "REPORT" 
| parse @message /Duration: (?<duration>.*?) ms/
| filter duration > 1000
| sort by duration desc
                                


< Back to snippets

GitHub icon View this snippet on GitHub


Running the CloudWatch snippet

Click on the button below to open up the snippet directly into your AWS account.

Manually running the CloudWatch snippet

2. Select Logs, and then choose Logs Insights.
3. In the Select log group(s) drop down, choose one or more log groups to query.
4. Copy snippet into query text area.
5. Click "Run Query"

Created by:

Pallavi Bhat

Pallavi Bhat

Pallavi is a Cloud Support Enginner focusing on serverless at Amazon Web Services.

Follow on LinkedIn