Highlight the cold starts in total invocations

Returns the percentage of cold starts in total invocations.

Cloudwatch Log Insights snippet that returns a report for the percentage of cold starts

filter @type = "REPORT"
| stats sum(ispresent(@initDuration))/count() * 100 as
  coldStartPct, avg(@duration)
  by bin(5m)
                                


< 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:

David Boyne

David Boyne

Helping people learn about event-driven architectures and serverless

Follow on LinkedIn

Christopher Osborn

Christopher Osborn

Software Engineer with a focus on serverless technologies.