-
Notifications
You must be signed in to change notification settings - Fork 153
feat(commons): make utilities aware of provisioned concurrency #3724
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
Conversation
aeaf638
to
e7c141e
Compare
Converted this back to draft because I wanted to extract the e2e test changes, but I'll do it on Monday. |
5436bf3
to
8b934e3
Compare
|
Integration tests are passing: https://github.com/aws-powertools/powertools-lambda-typescript/actions/runs/13944894973 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small comment, but feel free to ignore! Approved.
Summary
Changes
This PR modifies the logic used to detect cold starts by making it take into account the value of the
AWS_LAMBDA_INITIALIZATION_TYPE
env variable, which can haveon-demand
orprovisioned-concurrency
as values according to the environment in which the function is being run.Depending on the value, we either use the original logic (
on-demand
) or always default tofalse
, meaning not a cold start, when running under provisioned concurrency.This feature allows customers to have traces, logs, and metrics that are more accurate to the environment they're running their functions within.
The PR also introduces a new e2e test suite in Logger that covers some advanced cases that have been introduced in the past weeks, including this one:
Here's an example of a passing run: https://github.com/aws-powertools/powertools-lambda-typescript/actions/runs/13862082184
Issue number: closes #3723
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.