Azure / azure-functions-host

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

FunctionAppLogs from Diagnostic settings have different format at "properties" field by OS/SKU #7864

Open georgeOsdDev opened 2 years ago

georgeOsdDev commented 2 years ago

Investigative information

Please provide the following:

Repro steps

Provide the steps required to reproduce the problem:

Expected behavior

All OS and SKU should have same format.

Actual behavior

■Linux Elastic Premium "properties" is quoted with "(double quote),
key-values in stringifyed object are quoted with '(single quote)

{ "level": "Informational", "resourceId": "/SUBSCRIPTIONS/---/RESOURCEGROUPS/---/PROVIDERS/MICROSOFT.WEB/SITES/2111040060000473ELASTIC-LINUX", "operationName": "Microsoft.Web/sites/functions/log", "category": "FunctionAppLogs", "time": "11/15/2021 11:36:06", "properties": "{'appName':'2111040060000473elastic-linux','roleInstance':'4de66c2ce3805624b7e310460ca35c2789c27a85279b183e8c95aef70dd8d30a','message':'Starting JobHost','category':'Microsoft.Azure.WebJobs.Hosting.JobHostService','hostVersion':'4.0.1.16815','hostInstanceId':'3d7b63ad-2230-4902-9d52-195b26396d5f','level':'Information','levelId':2,'processId':19}", "EventStampType": "Stamp", "EventPrimaryStampName": "waws-prod-ty1-021", "EventStampName": "waws-prod-ty1-021e", "Host": "RD00155D7B6F5E", "EventIpAddress": "10.0.4.43"}

■Linux Consumption "properties" is not quoted, key-value in object are quoted with '(single quote) Single quotation in json object is invalid

{ "time": "2021-11-15T12:27:30Z", "resourceId": "/SUBSCRIPTIONS/---/RESOURCEGROUPS/---/PROVIDERS/MICROSOFT.WEB/SITES/2111040060000473CONSUMPTION-LINUX", "category": "FunctionAppLogs", "operationName": "Microsoft.Web/sites/functions/log", "level": "Informational", "properties": {'appName':'2111040060000473consumption-linux','roleInstance':'0F4222AC-637725731219525275','message':'Starting JobHost','category':'Microsoft.Azure.WebJobs.Hosting.JobHostService','hostVersion':'4.0.1.16815','hostInstanceId':'cf783750-4b85-42ad-ba30-09b691ad4643','level':'Information','levelId':2,'processId':71}}

■Windows Elastic Premium "properties" is not quoted, key-value in object are quoted with "(double quote) This format is totally valid json

{ "time": "2021-11-15T12:33:42.3447980Z", "resourceId": "/SUBSCRIPTIONS/---/RESOURCEGROUPS/---/PROVIDERS/MICROSOFT.WEB/SITES/2111040060000473ELASTIC-WINDOWS", "category": "FunctionAppLogs", "operationName": "Microsoft.Web/sites/functions/log", "level": "Informational", "location": "Japan East", "properties": {"appName":"2111040060000473elastic-windows","roleInstance":"2b4c36a34f16a3e3e5cff084e931fa6d2824e9831242d56c0be5eb98bc673cba","message":"Starting JobHost","category":"Microsoft.Azure.WebJobs.Hosting.JobHostService","hostVersion":"4.0.1.16815","hostInstanceId":"e36b2a05-2985-427f-8611-6f4aba67a07a","level":"Information","levelId":2,"processId":2552}}

■Windows Consumption "properties" is not quoted, key-value in object are quoted with "(double quote) This format is totally valid json This format is as same as Windows Elastic Premium

{ "time": "2021-11-15T12:30:45.9159658Z", "resourceId": "/SUBSCRIPTIONS/---/RESOURCEGROUPS---/PROVIDERS/MICROSOFT.WEB/SITES/2111040060000473CONSUMPTION-WINDOWS", "category": "FunctionAppLogs", "operationName": "Microsoft.Web/sites/functions/log", "level": "Informational", "location": "Japan East", "properties": {"appName":"2111040060000473consumption-windows","roleInstance":"d476ae96b48fc235309ba1fcc879ec5ce2731f618425933ab7d648744c03d544","message":"Starting JobHost","category":"Microsoft.Azure.WebJobs.Hosting.JobHostService","hostVersion":"4.0.1.16815","hostInstanceId":"6a179724-1237-4598-bc06-d9121dbf40ac","level":"Information","levelId":2,"processId":6796}}

Known workarounds

N/A

Related information

Provide any related information

Ved2806 commented 2 years ago

Thank you for your feedback! We will check for the possibilities internally and update you with the findings.

Ved2806 commented 2 years ago

Hi @pragnagopa , Could you please look into this?

pragnagopa commented 2 years ago

Thanks for reporting the issue. Tagging @CooperLink for initial investigation.

michaelpeng36 commented 2 years ago

As an FYI, it looks like this is occurring for Linux Dedicated as well, i.e. key-value pairs in the object under "properties" are quoted using single quotes.

georgeOsdDev commented 1 year ago

Hi @pragnagopa, @CooperLink Is there any update on this issue?

pragnagopa commented 1 year ago

Adding notes from ICM - 356696604

Linux Elastic Premium: Data time in US format Linux Dedicated: Data time in US format Linux Consumption: Data time in ISO 8601 format Windows Elastic Premium: Data time in ISO 8601 format Windows Dedicated: Data time in ISO 8601 format Windows Consumption: Data time in ISO 8601 format

This will be addressed as of breaking changes for Functions Runtime V5. No ETA yet.

pragnagopa commented 1 year ago

We are taking closer look into this - specifically to check if we can expose an opt-in flag for Cx to choose US format vs ISO 8601 format.

lauredon commented 1 year ago

This will be addressed as of breaking changes for Functions Runtime V5. No ETA yet.

Thanks for confirming this! Is there an update on the ETA for runtime v5?

kathykwon commented 1 year ago

This will be addressed as of breaking changes for Functions Runtime V5. No ETA yet.

Thanks for confirming this! Is there an update on the ETA for runtime v5?

+1, also curious if there is an ETA