Azure / Azure/azure-functions-host
X-MS-COLDSTART header not set in Flex
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
I’ve noticed a different behavior in Flex with respect to how we detect cold start compared to Windows Consumption. When testing with Windows Consumption, I see the X-MS-COLDSTART header in the request, but in Flex, this header isn’t set.
I typically add a [tag](https://github.com/Azure/azure-functions-host/blob/4f319dd75733fea1cdbec2d9d163435568604575/src/WebJobs.Script.WebHost/Features/FunctionExecutionFeature.cs#L65) if the request is a cold start, but since the header is missing, request.IsColdStart() returns false. This also means we will miss this [log](https://github.com/Azure/azure-functions-host/blob/4f319dd75733fea1cdbec2d9d163435568604575/src/WebJobs.Script.WebHost/Features/FunctionExecutionFeature.cs#L91) as coldStartData will be null.
The header is windows only and is set by MinIYarp on the worker.
Proposal: Set the header during specialization.
Contributor guide
Assessment
This issue has not been assessed yet.