Skip to content

Feature request: make cold start aware of Provisioned Concurrency #3723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
dreamorosi opened this issue Mar 13, 2025 · 2 comments · Fixed by #3724
Closed
2 tasks done

Feature request: make cold start aware of Provisioned Concurrency #3723

dreamorosi opened this issue Mar 13, 2025 · 2 comments · Fixed by #3724
Assignees
Labels
completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility logger This item relates to the Logger Utility

Comments

@dreamorosi
Copy link
Contributor

Use case

When using Provisioned Concurrency (PC) in AWS Lambda, the service initializes and keeps active a number of execution environments so that a portion of the requests can be served by these already-warm environments.

As a Powertools for AWS customer using PC, I'd like the cold start metric, log key, and tracer annotation to correctly reflect whether a request is a cold start or not - which is not currently the case.

Solution/User Experience

Currently Logger, Metrics, and Tracer are not aware of Provisioned Concurrency (PC) because the state required to report cold starts in all of them is maintained internally and is dependent on the amount of requests seen by the utility.

Lambda provides an environment variable AWS_LAMBDA_INITIALIZATION_TYPE that can have two values in the Node.js runtime: provisioned-concurrency or on-demand.

We could use this value to tweak our cold start detection logic to report a non-cold start (aka warm start) whenever PC is enabled.

This should not require any code changes from customers besides upgrading the packages to the latest version.

Alternative solutions

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

@dreamorosi dreamorosi added feature-request This item refers to a feature request for an existing or new utility triage This item has not been triaged by a maintainer, please wait labels Mar 13, 2025
@dreamorosi dreamorosi moved this from Triage to Backlog in Powertools for AWS Lambda (TypeScript) Mar 13, 2025
@dreamorosi dreamorosi added logger This item relates to the Logger Utility confirmed The scope is clear, ready for implementation and removed triage This item has not been triaged by a maintainer, please wait labels Mar 13, 2025
@dreamorosi dreamorosi self-assigned this Mar 13, 2025
@dreamorosi dreamorosi moved this from Backlog to Working on it in Powertools for AWS Lambda (TypeScript) Mar 13, 2025
@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in Powertools for AWS Lambda (TypeScript) Mar 19, 2025
Copy link
Contributor

⚠️ COMMENT VISIBILITY WARNING ⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added pending-release This item has been merged and will be released soon and removed confirmed The scope is clear, ready for implementation labels Mar 19, 2025
Copy link
Contributor

This is now released under v2.17.0 version!

@github-actions github-actions bot added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon labels Mar 25, 2025
@dreamorosi dreamorosi moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript) Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility logger This item relates to the Logger Utility
Projects
1 participant