Azure / azure-functions-host

The host/runtime that powers Azure Functions
https://functions.azure.com
MIT License
1.94k stars 441 forks source link

Update functions host to emit per invocation details to metering service #8228

Open divyagandhisethi opened 2 years ago

divyagandhisethi commented 2 years ago

We have been receiving CRIs which complain that the FunctionExecutionCount unit shown in portal for Linux ElasticPremium apps is not accurate. This is because today the platform publishes an aggregated count for the FunctionExecutionCount metric. As a repair item for these CRIs, we'll start publishing accurate execution counts from the host.

The change needs to go here - https://github.com/Azure/azure-functions-host/blob/c63da9b6baec5155fcda4a7a233a1c26ea41bee9/src/WebJobs.Script.WebHost/Diagnostics/LinuxAppServiceEventGenerator.cs#L64-L70

Instead of just publishing the timestamp, we need to also publish the execution stage for each function invocation. We have already made the corresponding change on the platform side to start consuming the new changes from the functions host. We have to wait for the platform changes to be deployed everywhere before making the change on the host side.

pragnagopa commented 2 years ago

Waiting for ANT 98 deployment to complete before picking work in the Host

pragnagopa commented 2 years ago

@divyagandhisethi - can you expand on why Host was writing time stamp until now?

cc @CooperLink

fabiocav commented 2 years ago

@pragnagopa / @divyagandhisethi the PR associated with that was automatically closed. Are you still planning on executing on this? If so, so this move to sprint 123?

fabiocav commented 2 years ago

@pragnagopa / @divyagandhisethi in review, there are questions about the why (more details to better understand the problem) here. Would you be able to please expand on that?

There are also questions about perf impact of this change, can you comment on that?

Thanks!

pragnagopa commented 2 years ago

Apologies missed pings on the issue here - associated PR - https://github.com/Azure/azure-functions-host/pull/8315 has the fix that is tested on private stamp - pending final verification from @divyagandhisethi

Prior to this change, logic that parsed console logs was very strict and did not allow adding more columns - associated changes on the Platform - https://msazure.visualstudio.com/One/_git/AAPT-Antares-Websites/pullrequest/5629271 have more details.

@divyagandhisethi - I am not aware of any perf impact with these changes - please confirm

fabiocav commented 2 years ago

Both PRs have been merged. Closing as resolved.

pragnagopa commented 2 years ago

Re-opening as the platform fix has issues when more logs are being sent from Functions Host. Keeping this issue open until we can roll out a permanent fix.

pragnagopa commented 2 years ago

@CooperLink - reactivating this issue to undo the temporary mitigation that is put in place as part of the - https://github.com/Azure/azure-functions-host/pull/8760 and https://github.com/Azure/azure-functions-host/pull/8759