Is it possible to get an overview of AWS Lambda cold starts, i.e. how many there were and how long they took?
I know there are solutions for cold starts, and I know I could log something on a cold start, but that is not what I need. I want an overview of cold starts in the past.
I know that a new log stream is created when a cold start occurs, so I though I'd use CloudWatch Insights to get the first record of type REPORT
for every log stream. But I can't manage to write a query that would group the reports by log stream and then take the first for every group.
This would give me an overview that I might be able to analyze in Excel, but the data is just too large for Excel:
filter @type = "REPORT"
| fields @logStream, @duration, @timestamp
| sort @logStream, @timestamp asc
I can get the stats max(@duration) by @logStream
but that's not what I want. I want the first record and the take the @duration
from there. Is this at all possible? Or should I be looking elsewhere?