How do you track initialization metrics for a Lambda function?

0

We configured provisioned concurrency for our Java Lambda function to reduce its startup time. Part of the function's startup time is the Java code initializing itself though, which isn't reduced by provisioned concurrency.

We'd like to know how long it takes for our code to initialize before it starts processing a request, so we can assess if it's worth the time and effort to optimize. I created a test system with a Java Lambda function, and activated AWS X-Ray with Active tracing, but I don't see a breakdown for initialization, invocation, and overhead.

What's the best way to track initialization metrics for a Lambda function?

已提问 4 年前1127 查看次数
1 回答
0
已接受的回答

When you turn on active tracing in AWS X-Ray, a trace automatically records information on the following subsegments of requests processed by the Lambda service that involve a cold start: Initialization, Invocation, and Overhead. If you're not seeing these subsegments in an AWS X-Ray trace, the request was likely made on a warmed instance.

For information on how to improve your Java Lambda function's performance, see How do I reduce initialization and invocation duration latency for my Java Lambda function?

AWS
已回答 4 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则