Azure / Azure/azure-functions-host
AzureMonitorDiagnosticLogger dynamic enable/disable
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 38
Description
Currently the AzureMonitorDiagnosticLogger is always in the logging pipeline, regardless of whether it is actually enabled via [diagnostic settings](https://docs.microsoft.com/en-us/azure/azure-functions/functions-monitor-log-analytics?tabs=csharp). Performance testing with the logger disabled in the host shows ~ 18% RPS improvement and ~ 15% latency improvement. So we really only want to enable this when needed.
Proposal: We add a new `WEBSITE_FUNCTIONS_AZUREMONITOR_ENABLED` environment variable that DWAS will use to pass us the enablement state of the feature, since this is tracked in SiteConfig. The host will only add the logger if either the setting isn't present (for back compat), or if it's present and the value is 1. This will enable us to release a host version that supports disabling this, ahead of the DWAS changes.
Contributor guide
Assessment
This issue has not been assessed yet.