You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generally, this would work by having a global variable (e.g. let visited) initialized to false. In our handler wrapper code, we would look at that variable and say if visited == false then coldStart else notColdStart. Right after we set visited to true.
I think this is a great idea but I still have my doubts about whether we can reliably do this from within the SDK:
Per definition, the global must be truly global so all handlers really share this global variable
What happens if one handler calls another one? The first one will examine coldStart the second one notColdStart.
Maybe we attach the context to the req object so that the case above is handled?
This issue has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
Looks interesting, I guess we could port this implementation to our instrumentation as well if we can access process.env.AWS_LAMBDA_INITIALIZATION_TYPE 🤔
Problem Statement
Customers would like to be able to differentiate events based on whether or not they are associated with a cold-start of a severless function.
The initial request specifically mentions Next.js when deployed to vercel.
Solution Brainstorm
Identifying whether or not the event context is from a cold-start using a tag may be very helpful.
Examples:
cc @lforst
The text was updated successfully, but these errors were encountered: