-
Notifications
You must be signed in to change notification settings - Fork 26
chore: Cold start with provisioned concurrency support #834
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
chore: Cold start with provisioned concurrency support #834
Conversation
…e and initialization type
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.
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Files not reviewed (1)
- version.json: Language not supported
Comments suppressed due to low confidence (1)
libraries/src/AWS.Lambda.Powertools.Common/Core/LambdaLifecycleTracker.cs:12
- [nitpick] Consider renaming '_isFirstContainer' to '_isFirstInvocation' to better reflect that it tracks the first invocation in the container; this may improve clarity for future maintainers.
private static bool _isFirstContainer = true;
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #834 +/- ##
===========================================
+ Coverage 74.15% 74.18% +0.03%
===========================================
Files 210 211 +1
Lines 8411 8430 +19
Branches 909 914 +5
===========================================
+ Hits 6237 6254 +17
- Misses 1881 1883 +2
Partials 293 293 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Issue number: #833
Summary
Changes
Add LambdaLifecycleTracker to manage cold start
This pull request introduces several updates to the AWS Lambda Powertools library, focusing on tracking Lambda lifecycle states, particularly cold starts, and improving initialization type handling. The most important changes include adding a new
LambdaLifecycleTracker
class, updating interfaces and constants, and incorporating the tracker into various aspects of the library.Lambda lifecycle tracking and initialization type handling:
New
LambdaLifecycleTracker
class:AsyncLocal
to maintain state across invocations.Updates to
IPowertoolsConfigurations
interface:IsColdStart
andAwsInitializationType
properties to indicate cold start status and Lambda initialization type, respectively.Constants update:
AWSInitializationTypeEnv
constant for theAWS_LAMBDA_INITIALIZATION_TYPE
environment variable to determine the Lambda function's initialization type.Integration of
LambdaLifecycleTracker
:LoggingAspect:
_isColdStart
flag withLambdaLifecycleTracker.IsColdStart
for cold start tracking.MetricsAspect:
_isColdStart
flag withLambdaLifecycleTracker.IsColdStart
and updated the reset logic. [1] [2]TracingAspect:
_isColdStart
flag withLambdaLifecycleTracker.IsColdStart
and updated the reset logic. [1] [2]Testing and version updates:
New tests for
LambdaLifecycleTracker
:Version updates:
Logging
,Metrics
, andTracing
components inversion.json
.User experience
Checklist
Please leave checklist items unchecked if they do not apply to your change.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
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.